Utility.GetAppLicenseInformation method
Returns a collection of all the app licenses assigned to the current user for the specified app for SharePoint in the given SharePoint deployment.
Namespace: Microsoft.SharePoint.Client.Utilities
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
Public Shared Function GetAppLicenseInformation ( _
context As ClientRuntimeContext, _
productId As Guid _
) As ClientResult(Of AppLicenseCollection)
'Usage
Dim context As ClientRuntimeContext
Dim productId As Guid
Dim returnValue As ClientResult(Of AppLicenseCollection)
returnValue = Utility.GetAppLicenseInformation(context, _
productId)
public static ClientResult<AppLicenseCollection> GetAppLicenseInformation(
ClientRuntimeContext context,
Guid productId
)
Parameters
- context
Type: Microsoft.SharePoint.Client.ClientRuntimeContext
productId
Type: System.GuidThe product ID of the app.
Return value
Type: Microsoft.SharePoint.Client.ClientResult<AppLicenseCollection>
A collection of all the app licenses assigned to the current user for the specified app for SharePoint.
Remarks
A user can have multiple app licenses assigned to them for the same app for in a given SharePoint deployment.
If multiple licenses are purchased for the same app, using different Microsoft accounts, the licenses are returned in the following order of priority:
Paid
Free
Unexpired Trial
Expired Trial
The GetAppLicenseInformation method does not return licenses with expired or preserved tokens. Preserved tokens are the license tokens which cannot be renewed automatically by SharePoint; in order to remain valid, preserved tokens must be renewed manually by having the purchaser sign in to the Office Store.
The product ID of an app can be found in the app manifest.
For more information about app licenses, see License your Office and SharePoint Add-ins.