Change Display name Bulk

berketjune2012 371 Reputation points

Hi I have a csv with the following headings:

Emailaddress, Current Display Name, New Display Name

What I'm trying to do is change the current ad display name to a new one.

Can someone suggest a powershell command that will import the csv file and make the change on AD on prem

I'm guessing it will have to use the emailaddress column since this is the attribute that is unique to identify the user to change.


Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,062 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dave Patrick 426.3K Reputation points MVP

  2. Limitless Technology 39,461 Reputation points

    Hello @berketjune2012

    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”  
    or in a more simplified way, with "Email" column name and "DisplayName" column:  
    Import-Csv 1.csv | Foreach {Get-User -Identity $ | Set-User -DisplayName $_.DisplayName}  

    Best regards,

    0 comments No comments