Microsoft Office, PVS KMS and Duplicate CMIDs – And How to Fix It!

1

Implementing Microsoft Office 2010/2013 with KMS activation using Citrix PVS can become a source of frustration for IT administrators – from previous experience Office KMS activation is definitely more of a pain to get right (and keep right) compared to your Windows Server activation.

Duplicate CMIDs for Office 2010/2013

Put simply, this is bad news. The CMID value is meant to be a unique identifier for each client computer running MS Office, but with PVS streaming a single image to multiple targets it’s pretty easy to make a mistake in the process, resulting in each computer returning the same CMID value. This in turn stops your KMS activation count from increasing on your KMS host server, causing Microsoft licensing implications.

Not only is this not cool for licensing reasons, but if you have just installed a new KMS key on your KMS host you will never reach the required count of 5 – your clients will never activate Office!

To check the CMID of a computer, run the following command from an elevated command prompt:

Office 2010

cd C:\Program Files\Microsoft Office\Office14

Cscript.exe ospp.vbs /dcmid

Office 2013

cd C:\Program Files\Microsoft Office\Office15

Cscript.exe ospp.vbs /dcmid

You should see something like the below:

Office CMID DCMID

N.B. Change the directory path is you have installed Office in a different location, i.e. on a different drive letter or to take into account a 32-bit install on a x64 OS.

If the command returns no value, you need to wait for Office to automatically send an activation request to the KMS host, which can take up to 30 mins. Run the following command to force it:

Cscript.exe ospp.vbs /act

Once you have the CMID value, run  the same command on a second target device that’s streaming the same vDisk image – if that returns the same CMID as your first, oh oh.

How Can This Happen?

For many different reasons! I’m sure there are more than those listed below, but these are scenarios I have confirmed with my own testing so far:

  • Microsoft Office was not re-armed correctly in the first place (check this article out before proceeding if this applies to you)
  • Microsoft Office has been manually activated whilst the PVS vDisk was in read/write mode after an already successful deployment (I.e. With the vDisk in private image mode or with a ‘maintenance’ version of the vDisk)
  • Microsoft Office was automatically activated because an Office product was run after a successful deployment whilst the PVS vDisk was in read/write mode (I.e. With the vDisk in private image mode or with a ‘maintenance’ version of the vDisk)

The last bullet is the most common reason I come across – even with the Office Customisation Tool or Office group policy template files admins may still have a requirement to perform additional configurations to Office not covered by those two utilities before sealing the vDisk. These admins open the image in read/write mode, run Office, perform the necessary changes, then re-seal thinking all is okay, when in fact this has messed up the KMS activation process.

Normally with PVS you don’t need to re-arm Windows/Office after editing the image – but by doing any of the above scenarios invalidates that condition. Once broken, fixing KMS activation takes more steps to fix than to maintain.

Re-Arming Office

Before re-arming Office you must change the properties of your vDisk.

  1. Change the access mode to Private Image
  2. Set the Microsoft Volume Licensing back to ‘None’ (I will explain why this is required later)
PVS vDisk Access Mode Private

PVS vDisk KMS None

Once this has been done and you have loaded the vDisk up on a target device in read/write mode, you need to re-arm BOTH Windows and Microsoft Office.

To re-arm Windows, run the following command:

SlMgr /ReArm

To re-arm Office, run one of the following:

C:\Program Files\Common Files\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.EXE

or

C:\Program Files (x86)\Common Files\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.EXE

Don’t run Office again! shut down the target device using your traditional sealing methods, then set the Access Mode and Microsoft Volume Licensing values back to what they were previously.

  1. Change the access mode to Standard Image
  2. Set the Microsoft Volume Licensing back to ‘KMS’

PVS vDisk Access Mode Standard

PVS vDisk KMS

So why do we need to change the vDisk from standard to private mode, in addition with resetting the Volume Licensing settings? This is because we need the Citrix PVS Stream Service to perform a KmsPrep/ KmsReset on the vDisk to prepare the vDisk for streaming, and it does this by mounting and unmounting the VHD file on the server. This only happens if you change the Access Mode from Private to Standard, and the KmsPrep / KmsReset occurs only when the KMS option is changed.

What If The Re-Arm Count Has Been Exceeded For Office…

Unfortunately a re-install of Office is required if that happens. Note if you do just a straight uninstall/reinstall of the Office suite the re-arm count doesn’t get reset – we have to do some registry deletion to get the vDisk back to square one and be able to rearm Office again.

  1. Follow the steps outlined previously to set the vDisk into Private access mode, with volume licensing set to ‘None’
  2. Start the vDisk on a target device
  3. Uninstall Office using Add/Remove Programs
  4. Delete the following from the registry
    1. HKLM\software\Microsoft\office
    2. HKLM\software\Microsoft\officesoftwareprotectionplatform (note for this key I had to take ownership of this key in the security properties before I could delete)
  5. Reboot the vDisk
  6. Reinstall Microsoft Office
  7. Run both the Windows Rearm command (slmgr.exe /rearm) and the Microsoft Office rearm (cscript.exe ospprearm.exe)
  8. Seal the image
  9. Change the vDisk properties back to the ‘Standard’ access mode and ‘KMS’ Microsoft Volume Licensing

…or For Windows?

This can be solved by setting the following registry key:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm = 0x1 (REG_DWORD).

Saves re-installing the OS and starting your vDisk from scratch!

But What About PVS 7.6?

If you read my previous article on an apparent bug with PVS 7.6 then you may wonder how the above could affect solutions using PVS 7.6 – changing the vDisk properties from ‘KMS’ activation to ‘None’ might break KMS activation completely for that vDisk until it has been re-imported as a new vDisk using the reverse imaging process. I haven’t had the opportunity yet to test this out, but once I do I will update this post to reflect my findings.

References

Configuring KMS Licensing for Windows and Office 2010 and 2013

Microsoft Community Thread

Share.

About Author

Luke is a Citrix & Microsoft IT consultant based in the UK. His Citrix qualifications include CCE-V, CCP-N and CCP-M. He also holds an MCSA in Windows Server 2012 and is a certified MCITP on Windows Server 2008. He loves cats but hates spiders and the cold.

1 Comment

  1. Russell Cram on

    Had an interesting one recently with this, did some windows/office updates to a vdisk with Office 2010 on and it looks like an update in a previous vdisk version had caused an office activation request, had to go back a couple of versions and redo some updates but it kept on causing an office activation when I did the updates. To get it working I had to disable the Office Software Protection Platform Service and then install the updates, reboot, re-enable the service and then seal the vdisk.

    Might be worth remembering to disable that service when doing Office Updates in the future!

Leave a Reply...