Windows Dev Center

SoftwareLicensingService class

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;
  string  DiscoveredKeyManagementServiceMachineName;
  uint32  DiscoveredKeyManagementServiceMachinePort;
  uint32  PolicyCacheRefreshRequired;
  string  ClientMachineID;
  uint32  RemainingWindowsReArmCount;
  uint32  KeyManagementServiceListeningPort;
  boolean KeyManagementServiceDnsPublishing;
  boolean KeyManagementServiceLowPriority;
  boolean KeyManagementServiceHostCaching;
  uint32  KeyManagementServiceUnlicensedRequests;
  uint32  KeyManagementServiceLicensedRequests;
  uint32  KeyManagementServiceOOBGraceRequests;
  uint32  KeyManagementServiceOOTGraceRequests;
  uint32  KeyManagementServiceNonGenuineGraceRequests;
  uint32  KeyManagementServiceTotalRequests;
  uint32  KeyManagementServiceFailedRequests;
  uint32  KeyManagementServiceNotificationRequests;
  string  TokenActivationILID;
  uint32  TokenActivationILVID;
  uint32  TokenActivationGrantNumber;
  string  TokenActivationCertificateThumbprint;
  string  TokenActivationAdditionalInfo;
  boolean KeyManagementServiceActivationDisabled;
};

Members

The SoftwareLicensingService class has these types of members:

Methods

The SoftwareLicensingService class has these methods.

MethodDescription
AcquireGenuineTicket

Acquires a genuine ticket online.

ClearKeyManagementServiceListeningPort

Clears any previously specified listening port. Applies to KMS hosts only.

ClearKeyManagementServiceMachine

Clears the key management service machine name.

ClearKeyManagementServicePort

Clears any previously specified port number.

ClearProductKeyFromRegistry

Clears a product key from the registry.

DisableKeyManagementServiceActivation

Disables volume activation through a KMS machine.

DisableKeyManagementServiceDnsPublishing

Disables the DNS publishing on a KMS host computer.

DisableKeyManagementServiceHostCaching

Disables the caching of the KMS hostname and port on a volume activation client.

EnableKeyManagementServiceLowPriority

Enables the KMS service to run with low priority.

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.

SetKeyManagementServiceListeningPort

Sets the TCP port on which a KMS host listens for activation requests. Applies to KMS hosts only. If a port is not specified, port 1688 is used.

SetKeyManagementServiceMachine

Sets the name of the key management service (KMS) machine to use for volume activation.

SetKeyManagementServicePort

Sets the TCP port that is used by a client to make requests of a KMS host. If a port is not specified, port 1688 is used.

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.

DiscoveredKeyManagementServiceMachineName
Data type: string
Access type: Read-only

Specifies the last discovered KMS host name through DNS.

DiscoveredKeyManagementServiceMachinePort
Data type: uint32
Access type: Read-only

Specifies the last discovered KMS host port through DNS.

IsKeyManagementServiceMachine
Data type: uint32
Access type: Read-only

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

ValueDescription

0

False

1

True

 

KeyManagementServiceActivationDisabled
Data type: boolean
Access type: Read-only

Indicates whether the volume activation through key management service is disabled.

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.

KeyManagementServiceDnsPublishing
Data type: boolean
Access type: Read-only

Indicates the DNS publishing status of a KMS host. The following values are possible.

ValueDescription

0

Disabled

1

Auto-publish enabled (default)

 

KeyManagementServiceFailedRequests
Data type: uint32
Access type: Read-only

Specifies the total count of failed KMS requests.

KeyManagementServiceHostCaching
Data type: boolean
Access type: Read-only

Indicates the caching status of the KMS host name and port. The following values are possible.

ValueDescription

0

Caching disabled

1

Caching enabled (default)

 

KeyManagementServiceLicensedRequests
Data type: uint32
Access type: Read-only

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

KeyManagementServiceListeningPort
Data type: uint32
Access type: Read-only

Specifies the TCP port on which the KMS host listens for activation requests.

KeyManagementServiceLowPriority
Data type: boolean
Access type: Read-only

Indicates the thread priority status of the KMS. The following values are possible.

ValueDescription

0

Normal priority (default)

1

Low priority

 

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.

ValueDescription

0

Refresh not required.

1

Refresh required.

 

RemainingWindowsReArmCount
Data type: uint32
Access type: Read-only

Specifies the remaining number of times that the client can be successfully rearmed.

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.

TokenActivationAdditionalInfo
Data type: string
Access type: Read-only

Specifies additional information for token-based activation.

TokenActivationCertificateThumbprint
Data type: string
Access type: Read-only

Specifies the thumbprint of the certificate that activated the computer.

TokenActivationGrantNumber
Data type: uint32
Access type: Read-only

Specifies the grant number in the token-based activation license that activated the computer.

TokenActivationILID
Data type: string
Access type: Read-only

Specifies the ID of the token-based activation license that activated the computer.

TokenActivationILVID
Data type: uint32
Access type: Read-only

Specifies the version of the token-based activation license that activated the computer.

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 7

Minimum supported server

Windows Server 2008 R2

Namespace

Root\CIMV2

MOF

SppWmi.mof

DLL

SppWmi.dll

See also

Software Licensing Classes for Windows Vista

 

 

Show:
© 2015 Microsoft