Avatar of gd6627
gd6627
Flag for United States of America asked on

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
Powershell

Avatar of undefined
Last Comment
gd6627

8/22/2022 - Mon
Justin Yeung

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

gd6627

ASKER
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
ASKER CERTIFIED SOLUTION
Justin Yeung

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gd6627

ASKER
How about job title? and I also need to add address, city, state , zip code
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy