0
PowerShell을 사용하여 레지스트리 키에서 사용자 권한을 제거하려고하지만 어려움이 있습니다. 현재 로그온 한 사용자 (User.Test)는 Internet Settings
키를 완벽하게 제어하지만 아래의 스크립트를 예약 된 작업으로 실행하면 사용자를 성공적으로 제거하지 못합니다. 누군가 도울 수 있습니까?PowerShell을 통해 레지스트리 사용 권한 부여
Set-ExecutionPolicy UnRestricted
$acl = Get-Acl -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"
$acl | Format-List
$user = New-Object System.Security.Principal.NTAccount("Domain\User.Test")
$permission = [System.Security.AccessControl.RegistryRights]"FullControl"
$inherit = [System.Security.AccessControl.InheritanceFlags]::None
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($user, $permission, $inherit, $propagation, $type)
$acl.RemoveAccessRuleAll($rule)
$acl | Set-Acl