Windows Media Rights Manager SDK banner art

WMRMRights.PMExpirationDate

The PMExpirationDate property specifies and retrieves the expiration date for a portable license.

This right has been deprecated. Expiration rights such as ExpirationDate, BeginDate, ExpirationAfterFirstUse, and ExpirationOnStore now apply to all licenses, including licenses on devices.

Syntax

WMRMRights.PMExpirationDate = String
String = WMRMRights.PMExpirationDate

Parameters

This property takes no parameters.

Return Values

If the property succeeds, it returns a String containing the expiration date. If it fails, it returns a number in the error object.

Return code Description
0x80004005 An unspecified error occurred.
0x80070057 The specified parameter is not valid.

Remarks

By default, this property is not set and the license does not expire. The PMExpirationDate property does not accept a date that is not valid. Dates in licenses are in Greenwich Mean Time (GMT) and must be formatted as follows:

#yyyymmdd hh:mm:ssZ#

  • Z is required.
  • hh:mm:ss is optional.
  • hh can be present without either mm or ss.
  • hh, mm and ss must be written with two digits each.

Correct examples:

#20050212Z#

#20050212 09Z#

#20050212 09:45Z#

#20050212 09:45:12Z#

Incorrect examples:

#20050212 9Z#

#20050212 09:Z#

#20050212 09:8Z#

Example Code

' Before you can issue a license, you must specify the consumer's
' rights and set them in the WMRMLicGen object.

' Declare objects.
    Dim sRights
    Dim RightsObj
    Dim LicGenObj

' Create objects.
    Set RightsObj = Server.CreateObject("Wmrmobjs.WMRMRights")
    Set LicGenObj = Server.CreateObject("Wmrmobjs.WMRMLicGen")

' Specify the rights that will be granted to the consumer.
    RightsObj.AllowBackupRestore = False
    RightsObj.AllowPlay = True
    RightsObj.AllowTransferToSDMI = True
    RightsObj.AllowTransferToNonSDMI = True
    RightsObj.TransferCount = 10
    RightsObj.ExpirationDate = "#20051231Z#"
    RightsObj.PMExpirationDate = "#20050930Z#"

' Retrieve the string containing the rights.
    sRights = RightsObj.GetAllRights()

' Set the rights in the license generator.
    LicGenObj.Rights = sRights

' Continue the license issuing process.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also