<

How to change display name of local Active Directory Users who are synced with AD users in Office 365 portal.

1,133 Points
133 Views
Last Modified:
Editors:
Saif Shaikh
CERTIFIED EXPERT
Worked for Microsoft 4 yrs. as an Exchange Admin. Has been in IT for the last 17 yrs. Currently working as Exchange and O365 migration Exp.
Lets take a scenario where all users in local AD has Display Name attribute set as surname, first name

We need to set the same to First Name, Last Name

Lets take a scenario where all users in local AD has Display Name attribute set as surname, first name

We need to set the same to First Name, Last Name


The users email address and SAM Account names are properly set i.e. firstname.lastname@domain.com


Example:

Open Powershell in elevated mode:


Run command: Import-module ActiveDirectory


Run command: Get-ADUser -SearchBase "ou=Test,DC=abc,DC=co,DC=uk" -Filter * -Properties displayna
me | select name, displayname

name                                                        displayname
----                                                        -----------
Ben Drake                                               Drake, Ben
Bryan John                                             John, Bryan
Chris Tosi                                               Tosi, Chris
Craig Mcmillam                                     Mcmillam, Craig
Den Murdoch                                       Murdoch, Den


As we can see that the displayname is surname,firstname for all users in specific OU.


Since we have already verified in local AD that users email address and SAM account name reflect First Name, Last Name. We just need to run below command to change the display name with First Name, Last Name 


- Ran command: Get-ADUser -SearchBase "ou=Test,DC=abc,DC=co,DC=uk" -Filter * -Properties displayname | ForEach-Object {Set-ADuser -Identity $_ -DisplayName $_.SamaccountName}


To verify you can again run command: Get-ADUser -SearchBase "ou=Test,DC=abc,DC=co,DC=uk" -Filter * -Properties displayname | select name, displayname


This time it will populate correct information i.e. display name has been set with First Name, Last Name.


Run delta synchronization from Azure AD Connect server and you are all set.


Run command: start-adsyncsynccycle -policytype delta


0
Author:Saif Shaikh
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Get 7 days free