Creating Users

Authors
  • avatar
    Name
    Michael Bui
    Twitter

Overview

In this lab we're going to create users using 3 different methods

  • Azure Portal, Azure CLI, and Azure PowerShell

Instructions

Azure Portal

Create a user with the following configurations

usernamebuitest1
NameBui Test1
Initial PasswordPassw0rd
Block signingyes
We're blocking signin so no one can log into this account
  1. Click on + New User
  2. Fill in the user information

Azure CLI

Documentation: Microsoft Docs

Create a user with the following Azure CLI is currently not as feature rich as the Portal / PowerShell

usernamebuicli
Initial PasswordPassw0rd

The following options are available:

az ad user create --display-name
                  --password
                  --user-principal-name
                  [--force-change-password-next-sign-in {false, true}]
                  [--immutable-id]
                  [--mail-nickname]
  1. Run the following command to create the user
az ad user create --display-name buicli --password Passw0rd --user-principal-name buicli@builab.ca

PowerShell

Documentation: Microsoft Docs

PowerShell creation is highly customizable and great to learn for automating user setup

Connect-AzureAD

run this before running other cmdlets to connect

  1. Run the following to create the user
$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$PasswordProfile.Password = "Passw0rd"

New-AzureADUser -DisplayName "buiPS" -PasswordProfile $PasswordProfile -UserPrincipalName "buiPS@builab.ca" -AccountEnabled $False -MailNickName "buiPS"
  1. You'll get text confirming the creation of the user object