WindowsLicensing CSP

The table below shows the applicability of Windows:

Edition Windows 10 Windows 11
Home Yes Yes
Pro Yes Yes
Windows SE No Yes
Business Yes Yes
Enterprise Yes Yes
Education Yes Yes

Warning

Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The WindowsLicensing configuration service provider is designed for licensing related management scenarios. Currently the scope is limited to edition upgrades of Windows 10 client devices, such as Windows 10 Pro to Windows 10 Enterprise. In addition, this CSP provides the capability to activate or change the product key of Windows 10 client devices.

The following example shows the WindowsLicensing configuration service provider in tree format.

./Vendor/MSFT
WindowsLicensing
----UpgradeEditionWithProductKey
----ChangeProductKey
----Edition
----Status
----LicenseKeyType
----CheckApplicability
----ChangeProductKey (Added in Windows 10, version 1703)
----Subscriptions (Added in Windows 10, version 1607)
--------SubscriptionId (Added in Windows 10, version 1607)
------------Status (Added in Windows 10, version 1607)
------------Name (Added in Windows 10, version 1607)
----SMode (Added in Windows 10, version 1809)
--------SwitchingPolicy (Added in Windows 10, version 1809)
--------SwitchFromSMode (Added in Windows 10, version 1809)
--------Status (Added in Windows 10, version 1809)

./Device/Vendor/MSFT/WindowsLicensing
This node is the root node for the WindowsLicensing configuration service provider.

The supported operation is Get.

UpgradeEditionWithProductKey
Enters a product key for an edition upgrade of Windows 10 desktop devices.

Note

This upgrade process requires a system restart.

The date type is a chr.

The supported operation is Exec.

When a product key is pushed from an MDM server to a user's device, changepk.exe runs using the product key. After it completes, a notification is shown to the user that a new edition of Windows 10 is available. The user can then restart their system manually or after two hours, the device will restart automatically to complete the upgrade. The user will receive a reminder notification 10 minutes before the automatic restart.

After the device restarts, the edition upgrade process completes. The user will receive a notification of the successful upgrade.

Important

If another policy requires a system reboot that occurs when changepk.exe is running, the edition upgrade will fail.

If a product key is entered in a provisioning package and the user begins installation of the package, a notification is shown to the user that their system will restart to complete the package installation. Upon explicit consent from the user to proceed, the package continues installation and changepk.exe runs using the product key. The user will receive a reminder notification 30 seconds before the automatic restart.

After the device restarts, the edition upgrade process completes. The user will receive a notification of the successful upgrade.

This node can also be used to activate or change a product key on a particular edition of Windows 10 desktop device by entering a product key. Activation or changing a product key doesn't require a reboot and is a silent process for the user.

Important

The product key entered must be 29 characters (that is, it should include dashes), otherwise the activation, edition upgrade, or product key change on Windows 10 desktop devices will fail. The product key is acquired from Microsoft Volume Licensing Service Center. Your organization must have a Volume Licensing contract with Microsoft to access the portal.

The following are valid edition upgrade paths when using this node through an MDM:

  • Windows 10/Windows 11 Enterprise to Windows 10/ Windows 11 Education
  • Windows 10/Windows 11 Home to Windows 10/Windows 11 Education
  • Windows 10/Windows 11 Pro to Windows 10/Windows 11 Education
  • Windows 10/Windows 11 Pro to Windows 10/Windows 11 Enterprise

Activation or changing a product key can be carried out on the following editions:

  • Windows 10/Windows 11 Education
  • Windows 10/Windows 11 Enterprise
  • Windows 10/Windows 11 Home
  • Windows 10/Windows 11 Pro

Edition
Returns a value that maps to the Windows 10 or Windows 11 edition. Take the value, convert it into its hexadecimal equivalent and search the GetProductInfo function page on MSDN for edition information.

The data type is an Int.

The supported operation is Get.

Status
Returns the status of an edition upgrade on Windows devices. The status corresponds to one of the following values:

  • 0 = Failed
  • 1 = Pending
  • 2 = In progress
  • 3 = Completed
  • 4 = Unknown

The data type is an Int.

The supported operation is Get.

LicenseKeyType
Returns the parameter type used by Windows 10 or Windows 11 devices for an edition upgrade, activation, or product key change.

  • Windows 10 or Windows 11 client devices require a product key.

The data type is a chr.

The supported operation is Get.

CheckApplicability
Returns TRUE if the entered product key can be used for an edition upgrade, activation or changing a product key of Windows 10 or Windows 11 for desktop devices.

The data type is a chr.

The supported operation is Exec.

ChangeProductKey
Added in Windows 10, version 1703. Installs a product key for Windows desktop devices. Doesn't reboot.

The data type is a chr.

The supported operation is Execute.

Subscriptions
Added in Windows 10, version 1607. Node for subscriptions.

Subscriptions/SubscriptionId
Added in Windows 10, version 1607. Node for subscription IDs.

Subscriptions/SubscriptionId/Status
Added in Windows 10, version 1607. Returns the status of the subscription.

The data type is an Int.

The supported operation is Get.

Subscriptions/SubscriptionId/Name
Added in Windows 10, version 1607. Returns the name of the subscription.

The data type is a chr.

The supported operation is Get.

SMode
Interior node for managing S mode.

SMode/SwitchingPolicy
Added in Windows 10, version 1809. Determines whether a consumer can switch the device out of S mode. This setting is only applicable to devices available in S mode. For examples, see Add S mode SwitchingPolicy, Get S mode SwitchingPolicy, Replace S mode SwitchingPolicy and Delete S mode SwitchingPolicy

Value type is integer.

Supported operations are Add, Get, Replace, and Delete.

Supported values:

  • 0 - No Restriction: The user is allowed to switch the device out of S mode.
  • 1 - User Blocked: The admin has blocked the user from switching their device out of S mode. Only the admin can switch the device out of S mode through the SMode/SwitchFromSMode node.

SMode/SwitchFromSMode
Added in Windows 10, version 1809. Switches a device out of S mode if possible. Doesn't reboot. For an example, see Execute SwitchFromSMode

Supported operation is Execute.

SMode/Status Added in Windows 10, version 1809. Returns the status of the latest SwitchFromSMode set request. For an example, see Get S mode status

Value type is integer.

Supported operation is Get.

Values:

  • Request fails with error code 404 - no SwitchFromSMode request has been made.
  • 0 - The device successfully switched out of S mode.
  • 1 - The device is processing the request to switch out of S mode.
  • 3 - The device was already switched out of S mode.
  • 4 - The device failed to switch out of S mode.

SyncML examples

CheckApplicability

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Exec>
    <CmdID>$CmdID$</CmdID>
    <Item>
      <Target>
        <LocURI>./Device/Vendor/MSFT/WindowsLicensing/CheckApplicability</LocURI>
      </Target>
      <Meta>
        <Format xmlns="syncml:metinf">chr</Format>
      </Meta>
      <Data>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Data> 
    </Item>
   </Exec>
   <Final/>
  </SyncBody>
</SyncML>

Note

XXXXX-XXXXX-XXXXX-XXXXX-XXXXX in the Data tag should be replaced with your product key.

Edition

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Get>
      <CmdID>$CmdID$</CmdID>
        <Item>
          <Target>
            <LocURI>./Device/Vendor/MSFT/WindowsLicensing/Edition</LocURI>
          </Target>
        </Item>
    </Get>
    <Final/>
  </SyncBody>
</SyncML>

LicenseKeyType

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Get>
      <CmdID>$CmdID$</CmdID>
        <Item>
          <Target>
            <LocURI>./Device/Vendor/MSFT/WindowsLicensing/LicenseKeyType</LocURI>
          </Target>
        </Item>
    </Get>
    <Final/>
  </SyncBody>
</SyncML>

Status

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Get>
      <CmdID>$CmdID$</CmdID>
        <Item>
          <Target>
            <LocURI>./Device/Vendor/MSFT/WindowsLicensing/Status</LocURI>
          </Target>
        </Item>
    </Get>
    <Final/>
  </SyncBody>
</SyncML>

UpgradeEditionWithProductKey

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Exec>
    <CmdID>$CmdID$</CmdID>
    <Item>
      <Target>
        <LocURI>./Device/Vendor/MSFT/WindowsLicensing/UpgradeEditionWithProductKey</LocURI>
      </Target>
      <Meta>
        <Format xmlns="syncml:metinf">chr</Format>
      </Meta>
      <Data>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Data> 
    </Item>
   </Exec>
   <Final/>
  </SyncBody>
</SyncML>

Note

XXXXX-XXXXX-XXXXX-XXXXX-XXXXX in the Data tag should be replaced with your product key.

Get S mode status

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Get>
      <CmdID>6</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/Status
          </LocURI>
        </Target>
      </Item>
    </Get>
    <Final/> 
  </SyncBody>
</SyncML>

Execute SwitchFromSMode

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Exec>
      <CmdID>5</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/SwitchFromSMode
          </LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">null</Format>
          <Type>text/plain</Type>
        </Meta>
        <Data></Data>
      </Item>
    </Exec>
    <Final/> 
  </SyncBody>
</SyncML>

Add S mode SwitchingPolicy

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Add>
      <CmdID>4</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/SwitchingPolicy
          </LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">int</Format>
          <Type>text/plain</Type>
        </Meta>
        <Data>1</Data>
      </Item>
    </Add>
    <Final/> 
  </SyncBody>
</SyncML>

Get S mode SwitchingPolicy

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Get>
      <CmdID>2</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/SwitchingPolicy
          </LocURI>
        </Target>
      </Item>
    </Get>
    <Final/> 
  </SyncBody>
</SyncML>

Replace S mode SwitchingPolicy

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Replace>
      <CmdID>1</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/SwitchingPolicy
          </LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">int</Format>
          <Type>text/plain</Type>
        </Meta>
        <Data>1</Data>
      </Item>
    </Replace>
    <Final/> 
  </SyncBody>
</SyncML>

Delete S mode SwitchingPolicy

<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncBody>
    <Delete>
      <CmdID>3</CmdID>
      <Item>
        <Target>
          <LocURI>
            ./Vendor/MSFT/WindowsLicensing/SMode/SwitchingPolicy
          </LocURI>
        </Target>
      </Item>
    </Delete>
    <Final/> 
  </SyncBody>
</SyncML>

Configuration service provider reference