License expiration date is exposed via the /beta/directory/subscriptions endpoint (look for the nextLifecycleDateTime property). Currently not supported in /v1.0.
How to fetch the expiration date of an license that's assigned to a user using Graph APIs? Is there any direct or indirect way available to get the data?
I need to know the API or a way to fetch the expiration date of an Azure license that's assigned to a user in a tenant.
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
2 answers
Sort by: Most helpful
-
Vasil Michev 119.7K Reputation points MVP Volunteer Moderator
2023-11-22T17:08:37.52+00:00 -
Sourabh Gupta 800 Reputation points Microsoft External Staff
2023-11-26T11:04:39.7166667+00:00 This Capability was introduced by Microsoft in Graph-Beta. Look for the nextLifecycleDateTime property
Using Graph API:
Using PowerShell:
Get-MgBetaDirectorySubscription
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
There was a feature requested by someone, which can be accessed here
Documentation: https://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
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".