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 Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 124K Reputation points MVP Volunteer Moderator
    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 805 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.