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.
Table of Contents
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 [[-TenantId] <String>]
Let’s discuss a few examples of how to use the Get-AzTenant PowerShell command.
You can run the below Azure PowerShell command to retrieve the lists of the tenants that are authorized for the current user.
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
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 – Video Tutorial
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 !!!
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.