How do I create an Azure AD user with Azure Portal, Powershell, azurecli, AzureCloudshell?

You can create an Azure AD user in multiple ways, including using the Azure portal, PowerShell, Azure CLI, and Cloud Shell. Here’s how you can create an Azure AD user using each of these methods:

Using Azure Portal:

Log in to the Azure portal.
Navigate to Azure Active Directory.
Select "Users" and click "New user."
Fill in the required information for the user, such as their name and username.
Optionally, you can assign licenses and roles to the user.
Click "Create" to create the user.

Using PowerShell:

Open PowerShell and connect to Azure AD using the Connect-AzureAD cmdlet.
Use the New-AzureADUser cmdlet to create a new user. Here's an example:

New-AzureADUser -DisplayName “John Doe” -UserPrincipalName “johndoe@contoso.com” -Password “P@ssw0rd1” -AccountEnabled $true

Replace the values for DisplayName, UserPrincipalName, Password, and AccountEnabled with the appropriate values for your user.
Press Enter to create the user.

Using Azure CLI:

Open Azure CLI and connect to Azure AD using the az login command.
Use the az ad user create command to create a new user. Here's an example:

az ad user create –display-name “John Doe” –user-principal-name “johndoe@contoso.com” –password “P@ssw0rd1” –account-enabled true

Replace the values for display-name, user-principal-name, password, and account-enabled with the appropriate values for your user.
Press Enter to create the user.

Using Cloud Shell:

Open Cloud Shell in the Azure portal.
Connect to Azure AD using the Connect-AzureAD cmdlet.
Use the New-AzureADUser cmdlet to create a new user. Here's an example:

New-AzureADUser -DisplayName “John Doe” -UserPrincipalName “johndoe@contoso.com” -Password “P@ssw0rd1” -AccountEnabled $true

Replace the values for DisplayName, UserPrincipalName, Password, and AccountEnabled with the appropriate values for your user.
Press Enter to create the user.

These are just some examples of how you can create an Azure AD user using different methods. Depending on your specific requirements and environment, there may be additional steps or options to consider.

Author: tonyhughes