Share via


SoftwareLicensingService class

Not supported. Use the SoftwareLicensingService class.

Windows Vista and Windows Server 2008: This class exposes the product-independent properties and methods of the Software Licensing service.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

class SoftwareLicensingService
{
  string Version;
  string KeyManagementServiceMachine;
  uint32 IsKeyManagementServiceMachine;
  uint32 VLActivationInterval;
  uint32 VLRenewalInterval;
  uint32 KeyManagementServiceCurrentCount;
  uint32 RequiredClientCount;
  string KeyManagementServiceProductKeyID;
  uint32 PolicyCacheRefreshRequired;
  string ClientMachineID;
  uint32 KeyManagementServiceUnlicensedRequests;
  uint32 KeyManagementServiceLicensedRequests;
  uint32 KeyManagementServiceOOBGraceRequests;
  uint32 KeyManagementServiceOOTGraceRequests;
  uint32 KeyManagementServiceNonGenuineGraceRequests;
  uint32 KeyManagementServiceTotalRequests;
  uint32 KeyManagementServiceFailedRequests;
  uint32 KeyManagementServiceNotificationRequests;
};

Members

The SoftwareLicensingService class has these types of members:

Methods

The SoftwareLicensingService class has these methods.

Method Description
AcquireGenuineTicket Acquires a genuine ticket online.
ClearKeyManagementServiceMachine Clears the key management service machine name.
ClearProductKeyFromRegistry Clears a product key from the registry.
InstallLicense Installs a license for the current product.
InstallLicensePackage Installs a license package for the current product.
InstallProductKey Installs a product key.
ReArmWindows Resets the licensing status of the machine.
RefreshLicenseStatus Updates the licensing status of the machine so that applications have access to current licensing information.
SetKeyManagementServiceMachine Sets the name of the key management service (KMS) machine to use for volume activation.
SetVLActivationInterval Sets the activation frequency, in minutes, of how often the current machine should contact the key management service machine before the client is licensed. The frequency must be greater than or equal to 15 and less than or equal to 43200. An error is returned if the method is called and the machine is not a key management service.
SetVLRenewalInterval Sets the renewal frequency, in minutes, of how often the current machine should contact the key management service machine after the client is licensed. The frequency must be greater than or equal to 15 and less than or equal to 43200. An error is returned if the method is called and the machine is not a key management service.

Properties

The SoftwareLicensingService class has these properties.

ClientMachineID

Data type: string

Access type: Read-only

Specifies the unique identifier for this volume client machine. The client includes this CMID in requests it sends to the KMS.

IsKeyManagementServiceMachine

Data type: uint32

Access type: Read-only

Indicates whether the machine has a key management service (KMS) enabled. The following values are possible.

Value Description
0
False
1
True

KeyManagementServiceCurrentCount

Data type: uint32

Access type: Read-only

Specifies the count of currently active volume clients. A value of -1 indicates that the machine is not enabled as a KMS or that it has not received any client licensing-requests.

KeyManagementServiceFailedRequests

Data type: uint32

Access type: Read-only

Specifies the total count of failed KMS requests.

KeyManagementServiceLicensedRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 1 (Licensed).

KeyManagementServiceMachine

Data type: string

Access type: Read-only

Specifies the registered key management service machine name. Returns null if SetKeyManagementServiceMachine has not been called.

KeyManagementServiceNonGenuineGraceRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 4 (NonGenuineGrace).

KeyManagementServiceNotificationRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 5 (Notification).

KeyManagementServiceOOBGraceRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 2 (OOBGrace).

KeyManagementServiceOOTGraceRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 3 (OOTGrace).

KeyManagementServiceProductKeyID

Data type: string

Access type: Read-only

Specifies the KMS product key ID. Returns null if not applicable.

KeyManagementServiceTotalRequests

Data type: uint32

Access type: Read-only

Specifies the total count of valid KMS requests.

KeyManagementServiceUnlicensedRequests

Data type: uint32

Access type: Read-only

Specifies the count of KMS requests from clients with LicenseStatus set to 0 (Unlicensed).

PolicyCacheRefreshRequired

Data type: uint32

Access type: Read-only

Indicates whether the licensing policy cache needs to be updated. The following values are possible.

Value Description
0
Refresh not required.
1
Refresh required.

RequiredClientCount

Data type: uint32

Access type: Read-only

Specifies the minimum number of clients required to connect to a KMS machine to enable volume licensing.

Version

Data type: string

Access type: Read-only

Qualifiers: Key

Specifies the version of the Software Licensing service.

VLActivationInterval

Data type: uint32

Access type: Read-only

Specifies the frequency, in minutes, of how often a client should contact the KMS machine before the client is licensed.

VLRenewalInterval

Data type: uint32

Access type: Read-only

Specifies the frequency, in minutes, of how often the current machine should contact the KMS machine after the client is licensed.

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
End of client support
Windows Vista
End of server support
Windows Server 2008
Namespace
Root\CIMV2
MOF
SLWmi.mof
DLL
SLWmi.dll

See also

SoftwareLicensingService