Skip to main content

tenant id get

Gets Microsoft 365 tenant ID for the specified domain

Usage

m365 tenant id get [options]

Options

-d, --domainName [domainName]

The domain name for which to retrieve the Microsoft 365 tenant ID

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

If no domain name is specified, the command will return the tenant ID of the tenant to which you are currently logged in.

Examples

Get Microsoft 365 tenant ID for the specified domain

m365 tenant id get --domainName contoso.com

Get Microsoft 365 tenant ID of the the tenant to which you are currently logged in

m365 tenant id get

Response

"e65b162c-6f87-4eb1-a24e-1b37d3504663"
CTRL + M