Bulk Update Microsoft 365 User Display Names with PowerShell
Question details
Update display names for many Microsoft 365 users using usernames and new names from a CSV file.

- Product
- Microsoft 365 and Microsoft Graph PowerShell
- Device & OS
- not provided
- Scenario
- An administrator needs to apply display name changes to thousands of Microsoft 365 accounts.
- Observed behavior
- The desired result is for each CSV entry to update the matching user's Microsoft 365 display name.
Prepare a CSV with UserPrincipalName and DisplayName headers, and confirm that each user principal name identifies the intended account. Use an account with an appropriate Microsoft Entra administrator role and permission to update users; some privileged accounts require additional permissions.
Update display names with Microsoft Graph PowerShell
Use a CSV file and Microsoft Graph PowerShell to update user accounts in batches.
Microsoft Graph PowerShell replaces the retired MSOnline module, so use Update-MgUser rather than the older Set-MsolUser command.
In a spreadsheet editor or text editor, create a UTF-8 CSV named users.csv with the headers UserPrincipalName,DisplayName. Add one account per row, for example: alex@example.com,Alex Morgan.
Open PowerShell and run: Install-Module Microsoft.Graph.Users -Scope CurrentUser. Accept any installation prompts, then run Import-Module Microsoft.Graph.Users.
Run Connect-MgGraph -Scopes "User.ReadWrite.All" and sign in with an appropriately authorized administrator account. Grant administrator consent if prompted and authorized to do so.
Create a test CSV containing only a few accounts, then run: Import-Csv ./test-users.csv | ForEach-Object { Update-MgUser -UserId $_.UserPrincipalName -DisplayName $_.DisplayName -ErrorAction Stop }. Correct any errors before continuing.
After the test succeeds, run: Import-Csv ./users.csv | ForEach-Object { Update-MgUser -UserId $_.UserPrincipalName -DisplayName $_.DisplayName -ErrorAction Stop }. Use the actual path to your CSV if it is not in the current PowerShell folder.
In the Microsoft 365 admin center, open Users > Active users and search for updated accounts. You can also run Get-MgUser -UserId "alex@example.com" -Property UserPrincipalName,DisplayName | Select-Object UserPrincipalName,DisplayName in PowerShell.

Prepare Your User List with WPS Spreadsheet
WPS Office is a free, lightweight Office alternative with a familiar interface for editing user lists. Open your existing spreadsheet or CSV, prepare the display names, and save a CSV for the Microsoft Graph PowerShell update. WPS does not update Microsoft 365 accounts itself.

Frequently Asked Questions
What columns does the CSV need?
Use UserPrincipalName and DisplayName as the header names. Each row should contain the target account's user principal name and its new display name.
Can I use Set-MsolUser for this update?
Set-MsolUser belongs to the retired MSOnline module. Use the Microsoft Graph PowerShell command Update-MgUser for the current approach.
Why does the update fail for some accounts?
Check the user principal name, the signed-in administrator's role, and consent for the User.ReadWrite.All permission. Updating privileged accounts can require additional permissions.
How can I confirm a display name changed?
Search for the user under Users > Active users in the Microsoft 365 admin center, or run Get-MgUser with the user's principal name and request the DisplayName property.
Can WPS Office make the Microsoft 365 changes?
WPS Spreadsheet can help prepare the CSV, but the account updates must be made through Microsoft Graph PowerShell or another authorized Microsoft 365 administration tool.




