Hi
Is there a way I can remove a user (in this case "NT Authority\Authenticated Users") from an OU using Powershell. Inheritance is blocked.
Ive attempted to the below but it doesnt seem to work: Any suggestions?
$acl = Get-Acl -Path "Path to OU" foreach($acc in $acl.access ) { $value = $acc.IdentityReference.Value if($value -match "NT Authority\Authenticated Users") { $ACL.RemoveAccessRule($acc) | Out-Null Set-Acl -Path "Path to OU" -AclObject $acl -ErrorAction Stop Write-Host "Remove ACL Entry: $value form" } }"