Skip to content

graph user get

Gets information about the specified user

Usage

graph user get [options]

Options

Option Description
--help output usage information
-i, --id [id] The ID of the user to retrieve information for. Specify id or userName but not both
-n, --userName [userName] The name of the user to retrieve information for. Specify id or userName but not both
-p, --properties [properties] Comma-separated list of properties to retrieve
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Important

Before using this command, log in to the Microsoft Graph, using the graph login command.

Remarks

To get information about a user, you have to first log in to the Microsoft Graph using the graph login command, eg. graph login.

You can retrieve information about a user, either by specifying that user's id or user name (userPrincipalName), but not both.

If the user with the specified id or user name doesn't exist, you will get a Resource 'xyz' does not exist or one of its queried reference-property objects are not present. error.

Examples

Get information about the user with id 1caf7dcd-7e83-4c3a-94f7-932a1299c844

graph user get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844

Get information about the user with user name AarifS@contoso.onmicrosoft.com

graph user get --userName AarifS@contoso.onmicrosoft.com

For the user with id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 retrieve the user name, e-mail address and full name

graph user get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --properties userPrincipalName,mail,displayName

More information