rss logo

How to create Microsoft Entra users using PowerShell or the Admin Center web interface

Microsoft 365 Logo

Entra ID can be seen as the cloud directory for Microsoft cloud services such as Microsoft Azure, Microsoft 365. It also handles identity management. Here I'll show how to create user accounts with PowerShell and from the Microsoft Entra admin center web interface.

Web Admin Center Interface

Open a web browser and enter https://entra.microsoft.com in the address bar.

  • Sign in with administrator credentials:
Microsoft Entra Login Page
  • In the navigation pane, click on All Users:
Microsoft Entra admin center interface displaying navigation panel with 'All users' highlighted under 'Users' section
  • Click on New user, then select Create new user:
Microsoft Entra admin center showing 'New user' dropdown menu with 'Create new user' option highlighted in the Users section
  • Enter the User principal name, the Display Name and set the password if necessary. Finally, click Next: Properties:
Microsoft Entra admin center Create new user screen with details filled for a user named Eric Cartman including username, display name, and password
  • Enter information such as First Name, Last Name and Usage location, then click Next: Assignements:
Microsoft Entra admin center Create new user screen with filled job and personal details for Eric Cartman including job title, company name, and department
  • Assign the User to a Group if necessary, then click Next: Properties:
Microsoft Entra admin center Create new user screen under Assignments tab showing no group or role assignments with navigation to next step highlighted
  • Check that the information provided on this page is correct and then click on Create:
Microsoft Entra admin center Create new user final review screen for Eric Cartman with user details and Create button highlighted

Create users by using PowerShell

  • If not already been done, install Microsoft.Graph API for current user:
PS C:\> Install-Module Microsoft.Graph -Scope CurrentUser
  • The PowerShell script execution policy must be set to remote signed or less restrictive. Otherwise, you may encounter the error Connect-MgGraph : An error occurred when writing to a listener. when attempting to connect:
PS C:\> PowerShell.exe -ExecutionPolicy RemoteSigned
  • Import the Microsoft.Graph module:
PS C:\> Import-Module Microsoft.Graph.Authentication
  • Optional, the Microsoft.Graph module can be updated with:
PS C:\> Update-Module Microsoft.Graph
  • Connect to the Microsoft.Graph API using administrator credentials:
PS C:\> Connect-MgGraph
  • Enter administrator credentials to connect:
Microsoft Entra Login Page
  • Set password profile:
PS C:\> $PWProfile = @{ Password = "A1TimePass!"; ForceChangePasswordNextSignIn = $true }
  • Create the new user:
PS C:\> New-MgUser ` -DisplayName "Eric Cartman" ` -GivenName "Eric" -Surname "Cartman" ` -MailNickname "e.cartman" ` -UsageLocation "US" ` -UserPrincipalName "e.cartman@std.rocks" ` -PasswordProfile $PWProfile -AccountEnabled ` -Department "fourth grade" -JobTitle "fatass" -CompanyName "Schoooool"
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address