JAEN

Microsoft 365

New-MgUser

CautionCreate cloud users

New-MgUser -DisplayName <n> -UserPrincipalName <upn> -MailNickname <nick> -AccountEnabled -PasswordProfile @{...}

Creates an Entra ID user via Graph; force a first-sign-in password change, then assign licenses.

Examples

  • New-MgUser -DisplayName '山田太郎' -UserPrincipalName [email protected] -MailNickname taro -AccountEnabled -PasswordProfile @{Password='TempP@ss1';ForceChangePasswordNextSignIn=$true}Onboard a new user

Syntax

New-MgUser -DisplayName n -UserPrincipalName upn -MailNickname nick -AccountEnabled -PasswordProfile @{Password='...';ForceChangePasswordNextSignIn=$true}

Before you run it

Hand over initial passwords securely.

Related commands

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store