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:
!["](https://www.gothamtg.com/pub/images/JosueWindowsKMSlicenseBlog1.png)
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:
!["](https://www.gothamtg.com/pub/images/JosueWindowsKMSlicenseBlog2.png)
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:
!["](https://www.gothamtg.com/pub/images/JosueWindowsKMSlicenseBlog3.png)
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.