Edit

Share via


Get-EntraSubscription

List the organization's commercial subscriptions.

Syntax

GetQuery (Default)

Get-EntraSubscription

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

GetById

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.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CommerceSubscriptionId

Specifies the subscription's ID in the commerce system.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SubscriptionId

Parameter sets

GetById
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Filter

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetQuery
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Property

Specifies properties to be returned.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Top

Specifies the maximum number of records to return.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Limit

Parameter sets

GetQuery
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Notes

Get-EntraDirectorySubscription is an alias for Get-EntraSubscription.