I'm new to AD - Automation via Powershell and although I managed to do Bulk Modify/Update the Location of our AD users based in our OU for some reason I am having difficulty replicating the script for the OU based in our on site office.
I hope i'm making sense here but probably this will help you answer or help me. Here is my script:
Import-Module ActiveDirectory
$Users = Import-Csv -Delimiter "," -Path "c:\scripts\van.csv"
Get-ADUser -Filter 'DisplayName -like "*"' | Set-ADUser -Replace @{PhysicalDeliveryOfficeName="Van Nuys"}
When I ran this script on Powershell what happens is it changes the location of the user's based in our OU not based on Van Nuys. The csv file that I have has DisplayName, Title and Office with the corresponding information of each users. But I don't know why it's changing the users in our OU.
I hope you can help me.
Sincerely, LP
$usersvariable anywhere... You're grabbing every user in your AD and setting their office location. - Nick