Bulk Update Existing Microsoft 365 Users with PowerShell
Question details
Update telephone numbers, addresses, and other profile details for existing Microsoft 365 users in bulk.
- Product
- Microsoft 365 admin center and Microsoft Graph PowerShell
- Device & OS
- not provided
- Scenario
- An administrator wants to apply profile changes to multiple existing accounts from a CSV file.
- Observed behavior
- The admin center's Add multiple users CSV import does not update the existing accounts.
Confirm that you have an appropriate Microsoft 365 administrator role and can grant the Microsoft Graph permissions needed to update users. Check whether the affected accounts are synchronized from an on-premises directory, because some synchronized properties must be changed at their source.
Update user profiles from a CSV with Microsoft Graph PowerShell
Use this method to update selected properties on existing accounts rather than importing them as new users.
The Add multiple users CSV feature is intended to create accounts. The older Set-MsolUser cmdlet belonged to the retired MSOnline module; use Microsoft Graph PowerShell for a current approach.
The example updates business phone, street address, and city. Blank cells are skipped rather than clearing existing values. Adjust the mapped properties for other supported user details.
Create a CSV file named users.csv with the headers UserPrincipalName, BusinessPhone, StreetAddress, and City. Add one existing user's sign-in name per row, along with the values to change.
Open PowerShell and run Install-Module Microsoft.Graph.Users -Scope CurrentUser. Then run Connect-MgGraph -Scopes "User.ReadWrite.All" and sign in with an authorized administrator account. Grant consent if prompted.
In PowerShell, replace the path below with your CSV location and run: $users = Import-Csv "C:\path\users.csv" foreach ($row in $users) { $params = @{} if ($row.BusinessPhone) { $params.BusinessPhones = @($row.BusinessPhone) } if ($row.StreetAddress) { $params.StreetAddress = $row.StreetAddress } if ($row.City) { $params.City = $row.City } if ($row.UserPrincipalName -and $params.Count -gt 0) { Update-MgUser -UserId $row.UserPrincipalName -BodyParameter $params } }
Run Get-MgUser -UserId "user@example.com" -Property userPrincipalName,businessPhones,streetAddress,city | Format-List UserPrincipalName,BusinessPhones,StreetAddress,City, replacing the example address with an updated user's sign-in name. Review any PowerShell errors for rows that did not update.

Prepare User Update Data with WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface. Use WPS Spreadsheets to organize user update data and save it as CSV before running Microsoft Graph PowerShell; WPS does not administer Microsoft 365 accounts.

Frequently Asked Questions
Why doesn't the Add multiple users CSV import update existing accounts?
The Add multiple users import is intended to create new accounts. For existing users, use Microsoft Graph PowerShell and Update-MgUser to apply the desired profile changes.
Can I still use Set-MsolUser for these updates?
Set-MsolUser was part of the retired MSOnline PowerShell module. Use Microsoft Graph PowerShell's Update-MgUser cmdlet instead.
What happens if a CSV field is blank?
In the example script, a blank BusinessPhone, StreetAddress, or City cell is skipped, so that property is not changed. Clearing a property requires an explicit update appropriate to that property.
Why might an update fail for a synchronized user?
Some properties of directory-synchronized accounts are managed in the on-premises directory. Check the property's source of authority and make the change there if it cannot be edited in Microsoft 365.
How can I check that a user's details were updated?
Run Get-MgUser with the user's sign-in name and the properties you changed, such as businessPhones, streetAddress, and city. You can also inspect the user's profile in the Microsoft 365 admin center.




