Others

Create Microsoft 365 Users in Bulk Without a First-Sign-In Password Change

Adam DavisAdam Davis Nov 18, 2026 869 views

Question details

Create Microsoft 365 users in bulk with individual passwords that do not have to be changed at first sign-in.

Create Microsoft 365 Users in Bulk Without a First-Sign-In Password Change
Product
Microsoft 365 and Microsoft Graph PowerShell
Device & OS
not provided
Scenario
An administrator wants to automate user creation from a CSV containing account details and individually generated passwords.
Observed behavior
Each new account is created with its assigned password and the first-sign-in password change setting disabled.
Before you start

Prepare a CSV with DisplayName, MailNickname, UserPrincipalName, and NewPassword columns, using a verified domain for each user principal name. Generate a unique password for each account, ensure it meets your organization's policy, and restrict access to the CSV because it contains plaintext passwords.

Solution 1Recommended

Create users from a CSV with Microsoft Graph PowerShell

Use this method to create new accounts with individual passwords and disable the first-sign-in password change flag.

The older MSOnline cmdlets, including Set-MsolUserPassword, are retired. Microsoft Graph PowerShell is the supported approach for this task.

This procedure creates new users; it does not update existing accounts or assign Microsoft 365 licenses.

1
Prepare the CSV

Create a CSV such as C:\O365\users.csv with the headers DisplayName,MailNickname,UserPrincipalName,NewPassword. Add one user per row, using a unique mail nickname and password for each account.

2
Install and connect to Microsoft Graph

In PowerShell, run Install-Module Microsoft.Graph.Users -Scope CurrentUser and Install-Module Microsoft.Graph.Authentication -Scope CurrentUser if the modules are not installed. Then run Connect-MgGraph -Scopes 'User.ReadWrite.All' and sign in with an account authorized to create users and grant the requested consent.

3
Create the accounts

Run the following command, replacing the path with your CSV location: Import-Csv -Path 'C:\O365\users.csv' | ForEach-Object { New-MgUser -BodyParameter @{ accountEnabled = $true; displayName = $_.DisplayName; mailNickname = $_.MailNickname; userPrincipalName = $_.UserPrincipalName; passwordProfile = @{ password = $_.NewPassword; forceChangePasswordNextSignIn = $false } } }

4
Check the results

In the Microsoft 365 admin center, open Users > Active users and verify that the new accounts appear. Review any PowerShell errors for rejected passwords, invalid domains, or duplicate account details, and assign licenses if needed.

5
Handle the password file

Deliver each password through an approved secure channel, then securely remove the CSV containing plaintext passwords when it is no longer needed.

Create users from a CSV with Microsoft Graph PowerShell
Other sign-in requirements may still apply: Disabling the first-sign-in password change flag does not override other organizational security policies, such as multifactor authentication or risk-based password resets.
Free Microsoft Office alternative

Prepare User Lists in WPS Spreadsheet

WPS Office is a free, lightweight Office alternative with a familiar interface and support for Microsoft Office formats, making it easy to move existing spreadsheets into WPS. Use WPS Spreadsheet to organize non-sensitive user details and export a CSV; Microsoft 365 administration still requires Microsoft tools.

Organize bulk user details in a spreadsheet and export them as CSVOpen and edit Microsoft Excel XLSX files for easier migrationWork with a familiar spreadsheet interfaceUse a free, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Why does Import-Csv say the delimiter must be one character?

The file path may have been passed as the delimiter. Use Import-Csv -Path 'C:\O365\users.csv'. If your file uses a semicolon, specify it separately with -Delimiter ';'.

Can I use Set-MsolUserPassword for this task?

Set-MsolUserPassword belongs to the retired MSOnline PowerShell module. Use Microsoft Graph PowerShell instead; the creation command in this guide sets forceChangePasswordNextSignIn to false for new users.

Does this command assign Microsoft 365 licenses?

No. After creating the accounts, open Users > Active users in the Microsoft 365 admin center and assign the appropriate licenses, or use your organization's licensing automation.

Will users still need to complete multifactor authentication?

Possibly. The password change flag does not disable multifactor authentication or other sign-in policies configured in your Microsoft 365 environment.

Can I use this CSV command to change passwords for existing users?

No. New-MgUser creates accounts and will fail for an existing user principal name. Updating existing users requires a separate Microsoft Graph update procedure and appropriate permissions.