Get-azurermsubscription

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.

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-AzureRmSubscription

you can see below, we got the expected output after executing the above command.

Get-azurermsubscription PowerShell cmdlet

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

How to get all subscriptions for a specific tenant

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.