az ad user

Manage Azure Active Directory users and user authentication.

Commands

az ad user create Request parameters for creating a new work or school account user.
az ad user delete Delete a 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 Gets user information from the directory.

az ad user create

Request parameters for creating a new work or school account user.

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

Required Parameters

--display-name

Object's display name or its prefix.

--password
--user-principal-name

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

Optional Parameters

--force-change-password-next-login
accepted values: false, true
--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az ad user delete

Delete a user.

az ad user delete --upn-or-object-id
[--subscription]

Required Parameters

--upn-or-object-id

The object ID or principal name of the user to delete.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az ad user get-member-groups

Get groups of which the user is a member.

az ad user get-member-groups --upn-or-object-id
[--security-enabled-only]
[--subscription]

Examples

Get groups of which the user is a member (autogenerated)

az ad user get-member-groups --upn-or-object-id myuser@consoso.com

Required Parameters

--upn-or-object-id

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

Optional Parameters

--security-enabled-only

If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az ad user list

List Azure Active Directory users.

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

Optional Parameters

--display-name

Object's display name or its prefix.

--filter

OData filter.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--upn

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

az ad user show

Gets user information from the directory.

az ad user show --upn-or-object-id
[--subscription]

Required Parameters

--upn-or-object-id

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

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.