Rhala
asked on
Update Users Properties in Active Directory by Script and CSV
Dear All,
I’m looking for a help to update all users properties and date in active directory (phone number, mobile number, department, office ... etc), i'm looking for help to find a script which can do this.
Please help.
Thanks
I’m looking for a help to update all users properties and date in active directory (phone number, mobile number, department, office ... etc), i'm looking for help to find a script which can do this.
Please help.
Thanks
something along this line will work
update-users.ps1
https://technet.microsoft.com/en-us/library/hh852287.aspx
update-users.ps1
$users = import-csv -path c:\scripts\update-users.csv
foreach ($user in $users){
Set-ADUser -Identity $user.samaccountname> -MobilePhone $user.mobile -OfficePhone $user.officephone
}
update-users.csvsamaccountname,mobile,officephone
johndoe,123-456-7890,789-123-1234x1234
https://technet.microsoft.com/en-us/library/hh852287.aspx
Not all properties are available with Set-AdUsers directly, but the common ones are. If you have difficulties to find the parameter names, post back with the details.
ASKER
thanks all,
does what you mentioned will overwrite what exists in AD?
also, is there a list of all AD properties in one CSV file which i can include all info and them update it one time
does what you mentioned will overwrite what exists in AD?
also, is there a list of all AD properties in one CSV file which i can include all info and them update it one time
ASKER
Hi All,
I found the below script which it seems it can do some work:
https://gallery.technet.microsoft.com/scriptcenter/Feeding-data-to-Active-0227d15c/view/Discussions#content
i need to ask how i can add or delete prosperities to the CSV file and then update the script based on that
I found the below script which it seems it can do some work:
https://gallery.technet.microsoft.com/scriptcenter/Feeding-data-to-Active-0227d15c/view/Discussions#content
i need to ask how i can add or delete prosperities to the CSV file and then update the script based on that
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CSV Example
sAMAccountName department Office phone mobilephone
dsmith accounting highbury xxx-xxx-xxxx xxx-xxx-xxxx
etc....
Open in new window
That should do it.
Will.