Get-AzTenant

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzTenant PowerShell command with examples of how to use this command.

Get-AzTenant

This command can help you get the lists of tenants authorized for the current user.

Syntax of Get-AzTenant

Below is the syntax of the Get-AzTenant PowerShell command.

Get-AzTenant
Get-AzTenant [[-TenantId] <String>]

Let’s discuss a few examples of how to use the Get-AzTenant PowerShell command.

Example-1

You can run the below Azure PowerShell command to retrieve the lists of the tenants that are authorized for the current user.

Get-AzTenant

After executing the above command, I got the below output

PS C:\windows\system32> Get-AzTenant

Id                                   Name              Category Domains                                
--                                   ----              -------- -------                                
5d9d690a-0310-474d-ae8b-42df2d5xxxxx Default Directory Home     fewlines4bijuhotmail.onmicrosoft.com   
1c93a0aa-e46f-4d02-9eea-bb1efbbexxxx Default Directory Home     fewlines4bijuhotmail265.onmicrosoft.com

You can see the same output below

Get-AzTenant

Example-2

You can run the below Azure PowerShell command to retrieve the tenant details of the specified tenant ID.

Get-AzTenant -TenantId 1c93a0aa-e46f-4d02-9eea-bb1efbbexxxx

After executing the above command, I got the expected output as below

Get-AzTenant PowerShell

Get-AzTenant PowerShell – Video Tutorial

Conclusion

In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzTenant PowerShell command with examples of how to use this command. Thanks for reading this article !!!