Set Job Title Using PowerShell

J

jlopez92

I'm trying to write a PS script to update the job title for users in AD. I was given a CSV file with a list of users email address and I'm using that.This is what my CSV file looks like:"ProfessionalEmail","Job Title""*** Email address is removed for privacy ***"," A POS"This is what my script looks like.Import-Module ActiveDirectoryImport-CSV -Path "pathforfile.csv" | Foreach-Object {# properties from the csv$mail = $_.ProfessionalEmail$title = $_.Job TitleGet-ADUser -Filter {(mail -eq "$mail")} | Set-ADUser -Title $title}Update:After running the scrip, PS does not return feedback and the AD attribute does not update for

Continue reading...
 
Back
Top Bottom