SetProductKey method of the Win32_WindowsProductActivation class

The SetProductKey WMI class method updates the system product key for a computer.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax

uint32 SetProductKey(
  [in] string ProductKey
);

Parameters

ProductKey [in]

Unique product key that is licensed for use on the computer. Product keys are alphanumeric strings of 25 characters formatted as follows: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx. The product key must be valid for the media type. Media types include retail, volume-licensing, and OEM.

Remarks

This method is only validif the ActivationRequired property is equal to 1.

Note

Windows Product Activation is not available on the Itanium-based versions of the Windows operating system.

Requirements

Minimum supported client
Windows XP
Minimum supported server
Windows Server 2003
End of client support
Windows XP
End of server support
Windows Server 2003 R2
Namespace
Root\CIMV2
MOF
Licwmi.mof
DLL
Licwmi.dll

See also

Win32_WindowsProductActivation

Windows Product Activation Provider