Get-AzTenant
Gets tenants that are authorized for the current user.
Syntax
Get-AzTenant
[[-TenantId] <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzTenant cmdlet gets tenants authorized for the current user.
Examples
Example 1: Getting all tenants
Connect-AzAccount
Get-AzTenant
Id Name Category Domains
-- ----------- -------- -------
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...}
yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com
This example shows how to get all of the authorized tenants of an Azure account.
Example 2: Getting a specific tenant
Connect-AzAccount
Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Id Name Category Domains
-- ----------- -------- -------
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...}
This example shows how to get a specific authorized tenant of an Azure account.
Parameters
-DefaultProfile
The credentials, tenant and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TenantId
Specifies the ID of the tenant that this cmdlet gets.
Type: | String |
Aliases: | Domain, Tenant |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Outputs
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure PowerShell