Michael Klopp

Michael Klopp

  • NA
  • 1
  • 1.1k

soloution which collect all users from a location in AD and

Feb 26 2015 4:33 AM
Hi together,
 
i need a soloution which collect all users from a location in AD and add them to a "location All Users" Group 
 
i have tried Powershell but this was far to slow to run once a day in our enviroment.
 
parameter for our enviroment (6 Domain Productiv , 6 Domains Integration) arround 200000 User 300 Location
 
Goal would be to have a script/program  witch can collect all users in a location and add them to the all Users Group and remove if not anymore in this location or disabled.
 
structure AD
 
root\world\country\location
 
so what i would need as C# dummy is a base script for checking 

6 or 12 Domains and doing some work in each Domain

in Powershell i had a soloution like this 

ForEach ($which in $DC) {
$DomName = ($which | Select-Object -unique -First 2).Split(".")[1]  
Switch ($DomName){
"auto"
 .....

and so on Zip includes the PS script which changed with replaced Server and Domains
 
greetings 
 

Attachment: group test.zip