Mr Woober
asked on
Populate department based on OU - Powershell
Hi,
Have some trouble getting this one :)
Scenario : Large organization with several offices/departments around the country. All offices have their own OU.
Department defines the different offices.
ex. get-aduser -searchscope "OU=office1,DC=Company,DC= intern" -filter * -properties department,company | set-aduser -department Office1.
get-aduser -searchscope "OU=$OU1,DC=Company,DC=int ern" -filter * -properties department,company | set-aduser -department $OU1
$OU1 should be generated from the object name that is defined on the user.
ex. company.inten/Office1/mr-w oober
So again, what i would like is to populate $OU1 to be the Office1 as given in example over. Powershell should populate this value.
The reason is that there are close to 70 offices and these changes alot :) Want to automate most of the populating.....
Have some trouble getting this one :)
Scenario : Large organization with several offices/departments around the country. All offices have their own OU.
Department defines the different offices.
ex. get-aduser -searchscope "OU=office1,DC=Company,DC=
get-aduser -searchscope "OU=$OU1,DC=Company,DC=int
$OU1 should be generated from the object name that is defined on the user.
ex. company.inten/Office1/mr-w
So again, what i would like is to populate $OU1 to be the Office1 as given in example over. Powershell should populate this value.
The reason is that there are close to 70 offices and these changes alot :) Want to automate most of the populating.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER