I am trying Set-Aclon a computer object in AD. First, I get the ACL using:
$acl = (Get-Acl AD:\'CN=Tester1,OU=Ou1,OU=OU2,OU=OU3,DC=Contoso,DC=com').Access
Which gives me all the ACLs for this computer object. Then I use:
$acl.AddAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("Computername","FullControl")))
Any pointers in the right direction are helpful. My goal is to add a computer object to the computer object "Tester1" and give it full access permissions.
source
share