
현재 실행 파일에 대한 '인증된 사용자' 권한을 'ReadAndExecute'로 설정하는 이 스크립트 파일이 있습니다. Windows 10에서는 제대로 작동하지만 Windows 7에서는 작동해야 하지만 그렇지 않습니다.
$file = (Resolve-Path 'c:\Dir\file.exe').Path;
$acl = (Get-Item $file).GetAccessControl('Access');
acl.SetAccessRuleProtection($True, $True);
$ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Authenticated Users', 'Write', 'None', 'None', 'Allow');
$acl.RemoveAccessRuleAll($ar);
$ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Authenticated Users', 'Modify', 'None', 'None', 'Allow');
$acl.RemoveAccessRuleAll($ar);
$ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Authenticated Users', 'ReadAndExecute', 'None', 'None', 'Allow');
$acl.SetAccessRule($ar);
Set-ACL -Path $file -AclObject $acl;
이것은 실행되지만 인증된 사용자에 대한 권한을 설정하지 않습니다. 매개 변수가 GetAccessControl
없도록 호출을 변경하면 'Access'
Win7에서 다음 오류가 발생합니다.
The security identifier is not allowed to be the owner of this object.
어쨌든 내가하려는 일을 달성 할 수 있습니까?
추가 요구사항:
- 컴퓨터에 다른 앱을 설치할 수 없습니다. Win 7의 바닐라 설치라고 생각하세요.
- 무인 설치 스크립트의 일부이므로 비대화식으로 실행해야 합니다.