I've got an problem creating new users in Active Directory. I've got a .csv file where I specified as one of many headers "location" with the City where the User will be situated, now I want to create the user in an OU that matches the "location" entry.
For example: "Location" is Dresden and OU is "OU=Users,OU=Dresden,OU=Germany,DC=acme,DC=com"
The same when location is "Munich" "OU=Users,OU=Munich,OU=Germany,DC=acme,DC=com"
I played around with Wildcars etc. but it seems there is a missing link in my brain, how can I create a variable- coming from the matching correct OU to set the correct -path command?
$Domain = 'dc=acme,dc=com'
$OUs = @( #what to put in here to make this to a matching variable?
"OU=Users,OU=Munich,OU=Germany,",
"OU=Users,OU=Munich,OU=Germany,",
)
Not sure If you can get my problem now :)
Dschordge