script on how to update AD user info data from csv file

Super Contributor

any script on how to update AD user info data from csv file?

 

UPNFirst NameMiddle NameLast NameTitleDepartmentCompany
anna@contoso.comAnnaSantosLunaVice ChairmanOffice of the Chairman and PresidentContoso Corp.
joy@contoso.comJoyVeraPerezAssistantLoans Processing CenterContoso Corp.
3 Replies

Give these ones of  Richard's a go.

User Administration (rlmueller.net)

 

 

 

will this work?

 

 

____________________

 

 

Import-Module ActiveDirectory
$csv = Import-Csv c:\users\user\Desktop\users.csv
foreach ($line in $csv) {
$UserPrincipalName = $line.UserPrincipalName
Get-ADUser -Filter {UserPrincipalName -eq $UserPrincipalName} |
Set-ADUser -Title $($csv.title) -Department $($csv.Department) -Company $($csv.company)
}


Write-Host "Done running Script"

Read-Host -Prompt "Press Enter to exit"

 

 

_-----------------------------

You can ask for help writing PowerShell scripts over here in dedicated forum.

windows-server-powershell - Microsoft Q&A