In this Azure PowerShell article, we will discuss the syntax and usage of the Get-azurermsubscription PowerShell Command with examples of how to use this command.
Table of Contents
Get-azurermsubscription
This is an excellent Azure PowerShell cmdlet to get the subscription details, i.e., subscription ID, subscription name, and home tenant the current account can access.
Syntax of Get-azurermsubscription
The syntax of the Get-azurermsubscription is as below
Get-AzureRmSubscription
[-SubscriptionId <String>]
[-TenantId <String>]We will consider some examples of how to use the Get-azure subscription PowerShell command.
Example 1: Retrieve all the subscriptions in all tenants
You can use the below Azure PowerShell cmdlet to get all the subscriptions in all tenants
PS C:\WINDOWS\system32> Get-AzureRmSubscriptionyou can see below, we got the expected output after executing the above command.

Example 2: How to get all subscriptions for a specific tenant
You can use the below Azure PowerShell cmdlet to retrieve all the subscriptions for a specific tenant.
PS C:\WINDOWS\system32> Get-AzureRmSubscription -TenantId "xxxx-xxxx-xxxx-xxxx"After executing the above command, you can see below we got the expected output

Get-azurermsubscription – Video Tutorial
You can also check out a Video tutorial on the Get-AzureRmSubscription PowerShell command.
You can also check out the Get-AzSubscription to retrieve all your Azure Subscriptions.
Final Thoughts
In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzureRmSubscription PowerShell command along with a few examples of how to use this command.

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, 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.
