question

leo-5383 avatar image
0 Votes"
leo-5383 asked ·

Set ACL of multiple group in AD via POWERSHELL

Hi everyone
sorry but i'm not very good with Powershell and I need to set the ACL permission for 500 security groups in AD, in particular I should give the rights of; WRITE, READ and DELETE to user TEST1 in all groups that i have exported in TXT file, I cant understand how to set the access rule .. I tried script below but I dont know if its ok

Set-Location AD:\
$groups = Get-Content c:\groups.txt
foreach ($group In $groups) {
$ace = (Get-Acl "AD:$((Get-ADgroup $group).DistinguishedName)").Access
foreach ($acl in $ace) {
$accessrule = New-Object System.Security.AccessControl.ActiceDirectoryAccessRule("domain\test1", "Allow")
$ace.AddAccessRule($accessrule)
Set-Acl -AclObject $ace $group.DistinguishedName -Verbose -Passthru
}
}
thanks

adfs
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

piaudonn avatar image
0 Votes"
piaudonn answered ·

This section is for AD FS. For AD DS questions, you can use the following forum: https://social.technet.microsoft.com/Forums/en-US/home?forum=winserverDS.


· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.