Hi, I need to update office locations for approx 1000 users, where the office field in AD has typo’s, should be something else etc etc. I want to script it, which should only be about 30 lines, but i’ve attached the first line as I can’t test due to live environment. Was hoping someone could verify if this is correct?
Use the -WhatIf parameter. It will tell you what it will try to do without executing. I do not think -PhysicalDeliveryOfficeName is a parameter in the Set-ADUser. Cmdlet. You should be able to use -Office
I sometimes, like to do it in a “stupid way” so i will out put each of the username and dump this in the text file, but this, if you want to execute it.
When you are ready to perform this, you can use the -Verbose or -Passthru parameters to show the output. The -Passthru parameter only has a limited amount of properties that can be shown and unfortunately Office is not one.
Example with -Verbose parameter:
[pre]
VERBOSE: Performing the operation “Set” on target “CN=Test User,OU=Users,DC=example,DC=com”.
[/pre]