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
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.
When set with Select, include the default property set alongside the values in Select rather than replacing them.
Set to 'eventual' to enable advanced query features such as $search, $count, or $orderby on non-indexed properties.
List users whose display name starts with the specified prefix.
Related properties to include in the response, for example memberOf.
OData $filter expression, for example "accountEnabled eq true".
OData $orderby values, for example 'displayName' or 'mail desc'.
OData $search expression, for example "displayName:ada". Requires ConsistencyLevel eventual.
Properties to return. Combine with AppendSelected to include the default properties as well.
List users with the specified user principal name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az msgraph user show
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
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.
When set with Select, include the default property set alongside the values in Select rather than replacing them.
Related properties to include in the response, for example memberOf.
Properties to return. Combine with AppendSelected to include the default properties as well.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.