< Back

Get-AzureRmTenant

Tue Jan 29, 2019 10:00 pm

NAME Get-AzureRmTenant



SYNOPSIS

Gets tenants that are authorized for the current user.





SYNTAX

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





DESCRIPTION

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





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, tenant and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-TenantId <String>

Specifies the ID of the tenant that this cmdlet gets.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

PSAzureTenant

This cmdlet returns the tenant ID and associated domain information for tenants authorized for the current account.





NOTES









Example 1: Getting all tenants



PS C:\\> Connect-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:\\> Connect-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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... rermtenant