Office remained unlicensed after the layer was published

Office 2021 was installed in an application layer for Windows Server 2019. Activation continued to fail after the layer was finalised and published.

The same behaviour occurred in both the development and test environments, indicating that the activation configuration was being carried within the application layer. Attempts to resolve the problem only after publishing the image did not provide a persistent fix.

The activation configuration contained a fixed KMS server

The following command was run from the Office16 directory on the packaging machine:

cscript ospp.vbs /dstatus

The licensing output showed that DNS-based KMS discovery was disabled and a specific KMS server had been configured. The configured server could not be resolved from the affected environments.

The corresponding KMS configuration was found under:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform

Because the configuration existed on the packaging machine, it was inherited by every image published with that layer.

The App Layer contained a stale KMS override

Office was not failing because of the installation itself. The application layer contained a hard-coded KMS server that was no longer resolvable.

Published servers therefore continued attempting activation against the invalid server instead of discovering an available KMS host through DNS.

Remove the KMS override before finalising the layer

On the packaging machine, an elevated Command Prompt was opened and the following command was run:

slmgr.vbs /ckms

This cleared the configured KMS server and allowed DNS-based KMS discovery to be used again. The application layer was then finalised and a new image was published.

No KMS hostname or environment-specific activation server was added back into the layer.

The published server discovered the correct KMS host

On a server created from the updated image, the following command was run:

slmgr.vbs /dlv

The licensing output confirmed that:

  1. The server was licensed.
  2. The previous hard-coded KMS server was no longer being used.
  3. The correct KMS server had been discovered through DNS.

Office activation remained successful after the updated layer was published.

06

Activation settings in the packaging machine become part of the published image

When Office activation fails consistently across multiple environments using the same application layer, the activation configuration inside the packaging machine should be checked.

A stale KMS override can be inherited by every published server. Clearing the override before finalising the layer allows each environment to use DNS-based KMS discovery.