Thursday, June 12, 2014

AD - Changing CompanyName in bulk with Powershell

While waiting for a new AddressList in Exchange to update I realized that there are at least 3 different variations of our Company Name in user objects that should only be one.  Granted they all mean the same thing however it's not perfect and I demand perfection!

Get-ADUser -SearchBase "ou=employees,ou=people,dc=domain,dc=com" -filter *

Gives me a nice list of every single user object in that OU, but now I need to pipe that output into a Set-ADUser cmdlet.

Get-ADUser -SearchBase "ou=employees,ou=people,dc=domain,dc=com" -filter * | Set-ADUser -company "ABC Widgets, Inc" 

And BOOM.

No comments:

Post a Comment