az msgraph user

Manage Microsoft Entra users.

Commands

Name Description Type Status
az msgraph user list

List Microsoft Entra users.

Core Preview
az msgraph user show

Get the details of a Microsoft Entra user.

Core Preview

az msgraph user list

Preview

List Microsoft Entra users.

List users in your Microsoft Entra tenant. Filter results by a display name prefix, exact user principal name, or an OData $filter expression. You can also project custom fields with --select, include relationships with --expand, and use advanced OData options like --orderby and --search. For advanced filters (for example endswith(...)), include --consistency-level eventual.

az msgraph user list [--append-selected]
                     [--consistency-level]
                     [--display-name]
                     [--expand]
                     [--filter]
                     [--orderby]
                     [--search]
                     [--select]
                     [--upn]

Examples

List all users

az msgraph user list

List users whose display name starts with a prefix

az msgraph user list --display-name Ada

List a user by user principal name

az msgraph user list --upn ada@contoso.com

List users with a custom filter expression

az msgraph user list --filter "endswith(mail,'@contoso.com')" --consistency-level eventual

List users with custom projection and default fields

az msgraph user list --select id displayName jobTitle --append-selected

Search users by display name

az msgraph user list --search "\"displayName:ada\"" --consistency-level eventual

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--append-selected

When set with Select, include the default property set alongside the values in Select rather than replacing them.

--consistency-level

Set to 'eventual' to enable advanced query features such as $search, $count, or $orderby on non-indexed properties.

--display-name

List users whose display name starts with the specified prefix.

--expand

Related properties to include in the response, for example memberOf.

--filter

OData $filter expression, for example "accountEnabled eq true".

--orderby

OData $orderby values, for example 'displayName' or 'mail desc'.

--search

OData $search expression, for example "displayName:ada". Requires ConsistencyLevel eventual.

--select

Properties to return. Combine with AppendSelected to include the default properties as well.

--upn

List users with the specified user principal name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az msgraph user show

Preview

Get the details of a Microsoft Entra user.

Retrieve full details for a user by object ID or user principal name.

az msgraph user show --id
                     [--append-selected]
                     [--expand]
                     [--select]

Examples

Show a user by user principal name

az msgraph user show --id user@contoso.com

Show a user by object ID

az msgraph user show --id 00000000-0000-0000-0000-000000000000

Show a user with selected fields only

az msgraph user show --id user@contoso.com --select id displayName mail

Show a user with selected fields plus default fields

az msgraph user show --id user@contoso.com --select id displayName mail --append-selected

Required Parameters

--id

The object ID or user principal name (UPN) of the user.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--append-selected

When set with Select, include the default property set alongside the values in Select rather than replacing them.

--expand

Related properties to include in the response, for example memberOf.

--select

Properties to return. Combine with AppendSelected to include the default properties as well.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.