combine several AccessRules into one single one - ACL of User Object in Active Directory
Wolfgang-2637
0
Reputation points
Hi,
I want to set a new ACL for one specific AD Group to an OU. This works fine but my solution now generates for each "New-Obejct..." one seperate AccessRule. That's logical but I don't want this.
The main code looks like this:
$ACL = Get-Acl -Path $TargetOU
$RuleLockoutTime = New-Object System.DirectoryServices.ActiveDirectoryAccessRule ($GroupSID,"WriteProperty","Allow",$GUID_1,"Descendents",$User)
$RuleResetPassword = New-Object System.DirectoryServices.ActiveDirectoryAccessRule ($GroupSID,"ExtendedRight","Allow",$GUID_2","Descendents",$User)
$Rule....... = New-Object System.DirectoryServices.ActiveDirectoryAccessRule (........
$ACL.AddAccessRule($RuleLockoutTime)
$ACL.AddAccessRule($RuleResetPassword)
$ACL.AddAccessRule($Rule......
Set-Acl -Path $TargetOU -AclObject $ACL
How can I put all together in one single AcccesRule? I already tried a lot but I never reached the right syntax.
Thanks in advance,
Wolfgang
Sign in to answer