Windows KMS License Activation Bug on Citrix and Azure Windows Server 2022

Windows KMS License Activation Bug on Citrix and Azure Windows Server 2022

By Josue Molina
Posted in Infrastructure, Support, Virtualization
On July 23, 2024

I recently stumbled upon a Citrix Windows KMS license activation bug that I thought would be good to share along with a workaround. The bug appeared after I created machines from a Windows Server 2022 Datacenter Azure Edition virtual machine template using Citrix Machine Creation Services (MCS). The Windows Server 2022 Datacenter Azure Edition version was 21H2 (OS Build 20348.2322).

The machines are created just fine, but when trying to log in to a virtual desktop, I noticed the “Activate Windows” desktop watermark background. To check things out further, I went to Windows Settings > Update & Security > Activation and confirmed the activation status was “Windows is not activated”.

Since these are machines hosted in Azure, I ran slmgr /dlv to retrieve the detailed volume activation license information, and to my surprise, all looked well. Its license status was "Licensed,” and the registered KMS machine name was azkms.core.windows.net:1688. To troubleshoot further, I ran a Test-NetConnection that also checked out fine.

The following screenshot shows the above-mentioned:

"

This led me to work with Microsoft via a support case where they advised that this was a bug in the license activation process for Windows Server 2022 Datacenter Azure Edition.

The provided workaround was to change the run user from “User” to “NT Authority\System” for the Windows scheduled task named “LicenseImdsIntegration”.

The following screenshot shows the before properties of the scheduled task:

"

You can do the workaround manually on the master image via Windows Task Scheduler or by running the following PowerShell command:

Schtasks /change /TN "\Microsoft\Windows\Clip\LicenseImdsIntegration" /RU "NT Authority\System"

I chose to automate it using a PowerShell sealer script that takes care of detecting the issue and applying the workaround. I also use this script for prepping, sealing, and shutting down the master image.

Here is a snippet of my code:

"

Microsoft stated that the license activation bug would be addressed in a future cumulative update. Although I have not received word that it has been fixed, I hope this blog provides insight into the bug's behavior and options to address it.

Please feel free to contact us for anything EUC-related or if you have any questions about automation.

Josue Molina

Josue Molina

Josue Molina is a Technical Architect at Gotham Technology Group. Josue is a technologist with over 20 years of experience in the design, development, and deployment of end-user computing solutions in a variety of industries.