Skip to content

Instantly share code, notes, and snippets.

@russom-woldezghi
Created February 1, 2013 21:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russom-woldezghi/4694227 to your computer and use it in GitHub Desktop.
Save russom-woldezghi/4694227 to your computer and use it in GitHub Desktop.
Update Active Directory users using PowerShell from .csv file (without using Quest).
Import-Module ActiveDirectory
$USERS = Import-CSV c:\scripts\usersupdate.csv
$USERS|Foreach{
Set-ADUSer -Identity $_.samaccountname -TelephoneNumber $_.TelephoneNumber -scriptPath $_.LoginScript -homeDirectory $_.HomeDirectory -title $_.JobTitle -department $_.Department -telephoneNumber $_.WorkPhone
-facsimileTelephoneNumber $_.Fax -office $_.Office -streetAddress $_.StreetAddress -l $_.City -st $_.State -postalCode $_.PostalCode -c $_.Country -company $_.Company -manager $_.ManagerAdspath }
@bastiangoonewardena
Copy link

Hi, I am extremely new to power shell scripting,
Currently using Windows server 2016, and trying to update my users on AD,

Possible for me to have a template of the .csv file?
Thank You
Bastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment