question

berket2020 avatar image
0 Votes"
berket2020 asked DSPatrick commented

Bulk update Display Names AD

Hello I have a csv fle. One column has the email address of the user. The other column has the new display name.

What I want to to do is bulk change multple user display names by reading from the csv file.

Can someone suggest a powershell command either for ad on prem or exchange on prem to accomplish this?

Thanks

Kashif

windows-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered DSPatrick commented
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just checking if there's any progress or updates?

--please don't forget to upvote and Accept as answer if the reply is helpful--



0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered LimitlessTechnology-2700 edited

Hello @berket2020

You can use the next script to update the display names, but needs some tunning depending on your file name and location and the name of colums (text within <>)

 $UserCount = 0
    
 Import-Csv -Path <C:\MyADUsers.csv> | ForEach-Object {
    
 $UPN = $_.<Name>
 Write-Host “Working on user:” $UPN
 Get-ADUser -Filter {Name -Eq $UPN} | Set-AdUser -Name $_.EmailAddress
 $usercount = $usercount +1
 }
 Write-Host “Total users on your CSV: $UserCount”
 Write-Host “UPN’s Changed”

Best regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.