az ad user

Manage Azure Active Directory users and user authentication.

Commands

az ad user create

Create an Azure Active Directory user.

az ad user delete

Delete Azure Active Directory user.

az ad user get-member-groups

Get groups of which the user is a member.

az ad user list

List Azure Active Directory users.

az ad user show

Show details for a Azure Active Directory user.

az ad user update

Update Azure Active Directory users.

az ad user create

Create an Azure Active Directory user.

az ad user create --display-name
                  --password
                  --user-principal-name
                  [--force-change-password-next-sign-in {false, true}]
                  [--immutable-id]
                  [--mail-nickname]

Examples

Create a user

az ad user create --display-name myuser --password password --user-principal-name myuser@contoso.com

Required Parameters

--display-name

Object's display name or its prefix.

--password

The password that should be assigned to the user for authentication.

--user-principal-name

The user principal name (someuser@contoso.com). It must contain one of the verified domains for the tenant.

Optional Parameters

--force-change-password-next-sign-in

Marks this user as needing to update their password the next time they authenticate. If omitted, false will be used.

accepted values: false, true
default value: False
--immutable-id

This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object.

--mail-nickname

Mail alias. Defaults to user principal name.

az ad user delete

Delete Azure Active Directory user.

az ad user delete --id

Examples

Delete Azure Active Directory users.

az ad user delete --id myuser@contoso.com

Required Parameters

--id

The object ID or principal name of the user for which to get information.

az ad user get-member-groups

Get groups of which the user is a member.

az ad user get-member-groups --id
                             [--security-enabled-only {false, true}]

Examples

Get groups of which the user is a member

az ad user get-member-groups --id myuser@contoso.com

Required Parameters

--id

The object ID or principal name of the user for which to get information.

Optional Parameters

--security-enabled-only

True to specify that only security groups that the entity is a member of should be returned; false to specify that all groups and directory roles that the entity is a member of should be returned.

accepted values: false, true
default value: False

az ad user list

List Azure Active Directory users.

az ad user list [--display-name]
                [--filter]
                [--upn]

Examples

List all the Azure Active Directory users

az ad user list

Optional Parameters

--display-name

Object's display name or its prefix.

--filter

OData filter, e.g. --filter "displayname eq 'test' and servicePrincipalType eq 'Application'".

--upn

User principal name, e.g. john.doe@contoso.com.

az ad user show

Show details for a Azure Active Directory user.

az ad user show --id

Examples

Show Azure Active Directory user.

az ad user show --id myuser@contoso.com

Required Parameters

--id

The object ID or principal name of the user for which to get information.

az ad user update

Update Azure Active Directory users.

az ad user update --id
                  [--account-enabled {false, true}]
                  [--display-name]
                  [--force-change-password-next-sign-in {false, true}]
                  [--mail-nickname]
                  [--password]

Examples

Update Azure Active Directory users.

az ad user update --id myuser@contoso.com --display-name username2

Required Parameters

--id

The object ID or principal name of the user for which to get information.

Optional Parameters

--account-enabled

Enable the user account.

accepted values: false, true
--display-name

Object's display name or its prefix.

--force-change-password-next-sign-in

If the user must change her password on the next login.

accepted values: false, true
--mail-nickname

Mail alias. Defaults to user principal name.

--password

User password.