Get-​Azure​Rm​Tenant

Gets tenants that are authorized for the current user.

Syntax

Get-AzureRmTenant
   [-TenantId <String>]
   [<CommonParameters>]

Description

The Get-AzureRmTenant cmdlet gets tenants authorized for the current user.

Examples

Example 1: Getting all tenants

PS C:\> Add-AzureRmAccount
PS C:\> Get-AzureRmTenant

TenantId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Domain   : microsoft.com

TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
Domain   : microsoft.com

This example shows how to get all of the authorized tenants of an Azure account.

Example 2: Getting a specific tenant

PS C:\> Add-AzureRmAccount
PS C:\> Get-AzureRmTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

TenantId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Domain   : microsoft.com

This example shows how to get a specific authorized tenant of an Azure account.

Optional Parameters

-TenantId

Specifies the ID of the tenant that this cmdlet gets.

Type:String
Aliases:Domain, Tenant
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

PSAzureTenant