Windows activation is handled by the system startup script installed in your OS layer, C:\Windows\Setup\Scripts\kmsdir\kmssetup.cmd. It calls runato.cmd and runipkato.cmd to actually perform the activation. If C:\Windows\setup\scripts\kmsdir is missing, or runato.cmd or runipkato.cmd (in the kmsdir folder) are missing, activation will never happen. You must configure out scripts properly to activate.
If the entire kmsdir folder is missing, please download the latest OS Machine Tools from
citrix.com/downloads and run it in a new version of your OS layer. Or run it in your Gold VM if you have already deleted your OS layer. The latest OS Machine Tools package will, when it self-extracts, install kmssetup.cmd as a startup script and also run the KMS configuration tool, SetKMSVersion.HTA. Those two should be all you need to get activation built properly. (If you are building a completely new Gold VM, don't forget to run setup_xxx.exe and do all the other configurations you're supposed to, of course.)
If you already have kmsdir, and do not want to upgrade your tools, then you need to go to C:\Windows\Setup\Scripts and run SetKMSVersion.hta. It will identify your current build of Windows and offer to save the activation scripts to get that specific build activated. You can verify that the runato.cmd and runipkato.cmd files have been created properly.
If issues persist, please refer to the Office recipe:
https://support.citrix.com/article/CTX224566NOTE: you must never manually run kmssetup.cmd in any app layer. If you manually run kmssetup.cmd, you will break activation on your published images. kmssetup.cmd creates various files with the suffix "_done" wwhich indicate it has performed functions and does not perform them again. These functions are supposed to run on a published image only, and if the "_done" files are in the OS or App layers, they will not run on the published image.
Problem Cause
KMS activation has not been properly configured in the OS layer. Either the tools and scripts were not installed, or not configured properly so that our activation CMD files are not present.