How to get license expiry date with Get-MgSubscribedSKU cmdlet

Büchner, Sarah 0 Reputation points
2023-11-20T13:06:21.2933333+00:00

Hello,

The Get-MsolSubscription cmdlet expires in March 2024. Therefore, we want to migrate to Get-MgSubscribedSKU cmdlet. The problem is that we cannot get license exipiry date with the Get-MgSubscribedSKU. Does anybody know if this is something that will still be added by Microsoft? If so, when? Do you know if we can we still use the old cmdlet until all functionalities will be transferred to the new cmdlet?

Thanks in advance!
Sarah

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,411 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,577 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 100.1K Reputation points MVP
    2023-11-20T16:44:41.3766667+00:00

    Use the Get-MgBetaDirectorySubscription cmdlet, or the corresponding endpoint:

    GET https://graph.microsoft.com/beta/directory/subscriptions

    Both are only available under /beta currently.

    0 comments No comments

  2. Sourabh Gupta 800 Reputation points Microsoft Vendor
    2023-11-26T12:25:04.0766667+00:00

    Hi Sarah,

    This Capability was introduced by Microsoft in Graph-Beta. Look for the nextLifecycleDateTime property

    There was a feature requested by someone, which can be accessed here

    Using PowerShell:

    Get-MgBetaDirectorySubscription

    Using Graph API:

    https://graph.microsoft.com/beta/directory/subscriptions?$select=id,nextLifecycleDateTime,createdDateTime,ocpSubscriptionId

    Permissions Needed:

    Delegated (work or school account) - Organization.Read.All, Directory.Read.All

    Delegated (personal Microsoft account) - Not supported.

    Application - Organization.Read.All, Directory.Read.All, Organization.ReadWrite.All

    Documentationhttps://learn.microsoft.com/en-us/graph/api/directory-list-subscriptions?view=graph-rest-beta&tabs=http

    Refer to the screenshot below for the sample response

    IMG20231125221438

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments