Others

Bulk Update Existing Microsoft 365 Users with PowerShell

John WilsonJohn Wilson Nov 22, 2026 868 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Prepare the CSV

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.

2
Install and connect

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.

3
Run the updates

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 } }

4
Verify a user

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.

Update user profiles from a CSV with Microsoft Graph PowerShell
Test a small batch first: Start with one or two users and verify the results before processing the full CSV. Some protected accounts or properties may require additional permissions or a different administrator role.
Free Microsoft Office alternative

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.

Organize user names, phone numbers, and addresses in a spreadsheet before exporting a CSV.Open and edit Microsoft Excel formats such as XLSX for easy migration.Use a familiar spreadsheet interface to review rows and column headers.Work with a free, lightweight office suite.
QA img-9

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.