Edit

Share via


Get-EntraSubscription

List the organization's commercial subscriptions.

Syntax

Get-EntraSubscription
   [-Top <Int32>]
   [-All]
   [-Filter <String>]
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraSubscription
   -CommerceSubscriptionId <String>
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraSubscription cmdlet lists the organization's commercial subscriptions.

In delegated scenarios with work or school accounts, when acting on another user, the signed-in user must have a supported Microsoft Entra role or a custom role with the necessary permissions. The following least privileged roles support this operation:

  • Dynamics 365 Business Central Administrator - read only standard properties
  • Global Reader
  • Directory Readers

Examples

Example 1: Get all organization's commercial subscriptions

Connect-Entra -Scopes 'Organization.Read.All'
Get-EntraSubscription -All

skuPartNumber          : POWER_BI_STANDARD
ownerId                :
id                     : aaaa0000-bb11-2222-33cc-444444dddddd
nextLifecycleDateTime  : 9/24/2025 11:59:59 PM
ownerType              :
isTrial                : True
ownerTenantId          :
createdDateTime        : 9/24/2023 12:00:00 AM
serviceStatus          : {EXCHANGE_S_FOUNDATION, DYN365_ENTERPRISE_P1_IW}
totalLicenses          : 1
skuId                  : 0000aaaa-11bb-cccc-dd22-eeeeee333333
status                 : Enabled
commerceSubscriptionId : eeeeeeee-4444-5555-6666-ffffffffffff

This example demonstrates how to retrieve specified commercial subscriptions.

Example 2: Get commercial subscriptions by CommerceSubscriptionId

Connect-Entra -Scopes 'Organization.Read.All'
Get-EntraSubscription -CommerceSubscriptionId 'eeeeeeee-4444-5555-6666-ffffffffffff'

skuPartNumber          : POWER_BI_STANDARD
ownerId                :
id                     : aaaa0000-bb11-2222-33cc-444444dddddd
nextLifecycleDateTime  : 9/24/2025 11:59:59 PM
ownerType              :
isTrial                : True
ownerTenantId          :
createdDateTime        : 9/24/2023 12:00:00 AM
serviceStatus          : {EXCHANGE_S_FOUNDATION, DYN365_ENTERPRISE_P1_IW}
totalLicenses          : 1
skuId                  : 0000aaaa-11bb-cccc-dd22-eeeeee333333
status                 : Enabled
commerceSubscriptionId : eeeeeeee-4444-5555-6666-ffffffffffff

This example demonstrates how to retrieve specified commercial subscriptions by CommerceSubscriptionId.

  • -CommerceSubscriptionId parameter specifies the subscription's ID in the commerce system.

Example 3: Get available license plans with filtering

Connect-Entra -Scopes 'Organization.Read.All'
Get-EntraSubscription -Filter "id eq 'aaaa0000-bb11-2222-33cc-444444dddddd'"

skuPartNumber          : POWER_BI_STANDARD
ownerId                :
id                     : aaaa0000-bb11-2222-33cc-444444dddddd
nextLifecycleDateTime  : 9/24/2025 11:59:59 PM
ownerType              :
isTrial                : True
ownerTenantId          :
createdDateTime        : 9/24/2023 12:00:00 AM
serviceStatus          : {EXCHANGE_S_FOUNDATION, DYN365_ENTERPRISE_P1_IW}
totalLicenses          : 1
skuId                  : 0000aaaa-11bb-cccc-dd22-eeeeee333333
status                 : Enabled
commerceSubscriptionId : eeeeeeee-4444-5555-6666-ffffffffffff

This example demonstrates how to retrieve specified commercial subscriptions with filtering Id property.

Example 4: Retrieve subscription's SKU (store keeping unit)

Connect-Entra -Scopes 'Organization.Read.All'
Get-EntraSubscription -Property skuPartNumber, Status | Select-Object skuPartNumber, Status

skuPartNumber                                                   status
-------------                                                   ------
STREAM                                                          Enabled
EMSPREMIUM                                                      Enabled
UNIVERSAL_PRINT_M365                                            Enabled
Microsoft_365_Copilot                                           Enabled
WINDOWS_STORE                                                   Enabled

This example demonstrates how to retrieve the subscription's SKU. You can use -Select as an alias for -Property.

Example 5: Get a list of active commercial subscriptions

Connect-Entra -Scopes 'Organization.Read.All'
Get-EntraSubscription |
    Where-Object {
        ($_.Status -ne "Suspended" -and $_.Status -ne "LockedOut") -and
        ($_.NextLifecycleDateTime -ne $null)
    } |
    Sort-Object NextLifecycleDateTime |
    Select-Object *

skuPartNumber          : POWER_BI_STANDARD
ownerId                :
id                     : aaaa0000-bb11-2222-33cc-444444dddddd
nextLifecycleDateTime  : 9/24/2025 11:59:59 PM
ownerType              :
isTrial                : True
ownerTenantId          :
createdDateTime        : 9/24/2023 12:00:00 AM
serviceStatus          : {EXCHANGE_S_FOUNDATION, DYN365_ENTERPRISE_P1_IW}
totalLicenses          : 1000
skuId                  : 0000aaaa-11bb-cccc-dd22-eeeeee333333
status                 : Enabled
commerceSubscriptionId : eeeeeeee-4444-5555-6666-ffffffffffff

This example demonstrates how to retrieve active commercial subscriptions.

Parameters

-All

List all pages.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CommerceSubscriptionId

Specifies the subscription's ID in the commerce system.

Type:System.String
Aliases:SubscriptionId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Filter

Specifies an OData v4.0 filter statement. This parameter filters which objects are returned.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Property

Specifies properties to be returned.

Type:System.String[]
Aliases:Select
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:System.Int32
Aliases:Limit
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Notes

Get-EntraDirectorySubscription is an alias for Get-EntraSubscription.