AD Powershell

I need to update user parameter fields in AD like  Description , office , job tittle, Department, Conmpany and Manager.

I have a csv file from a payroll system that I need to use as master file ,

I would like a powershell script that can read the user file and update those fields in AD
gd6627Asked:
Who is Participating?
 
Justin YeungSenior Systems EngineerCommented:
Yes it will just over write the existing with the same manager.
0
 
Justin YeungSenior Systems EngineerCommented:
assume your csv header is samaccountname,description,office,department,company,manager

$objects = import-csv -Path c:\temp\import.csv

foreach ($Object in $objects)
{
Set-ADUser $Object.SamAccountname `
-Description $object.description `
-Office $Object.office `
-Department $object.department `
-Company $object.company `
-Manager (Get-ADUser $object.Manager)
}

Open in new window

3
 
gd6627Author Commented:
Justin if I already have the manager sam account associated with the user can I just list it in the csv file?  I also need to add job title
0
 
gd6627Author Commented:
How about job title? and I also need to add address, city, state , zip code
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.