MilesLogan
asked on
Add AD Accounts to a group if the Distinguished name matches a certain criteria
Hi EE , need some help if someone wants to help solve this puzzle ..
1) Check Group1
2) If Distinguised name or CanonicalName contains "area1" , "area2" , "area3"
3) Add those accounts to Group2
4) Export CSV of SamaccountName added to Group2
*** Group1 contains over 50K users ***
1) Check Group1
2) If Distinguised name or CanonicalName contains "area1" , "area2" , "area3"
3) Add those accounts to Group2
4) Export CSV of SamaccountName added to Group2
*** Group1 contains over 50K users ***
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you oBdA , I tried it on a small group and it worked ..I wont try on the large group until tonight .
What does this do ?
$chunkSize = 5000
If ($members.Count -eq $chunkSize)
What does this do ?
$chunkSize = 5000
If ($members.Count -eq $chunkSize)
Adding one account at a time is rather ineffective, but there's a limit on the request size the AD web service accepts.
It's usually not an issue, but with potentially that many accounts to add, this makes sure that the accounts are only added in batches of this size.
If it bails out anyway, try to lower this size.
It's usually not an issue, but with potentially that many accounts to add, this makes sure that the accounts are only added in batches of this size.
If it bails out anyway, try to lower this size.
ASKER
ok cool .. thank you so much !
ASKER
I will try it in a couple hours , thank you