Setting a static KMS Server during OSD in ConfigMgr

Microsoft’s Key Management Server, better known as KMS, is around for many years and helps Administrators around the world activating Microsoft Products in their Enterprises. This includes Products like Windows or Office, for example.

Usually, a Client uses a DNS Service Locator to find its KMS Server for sending the Activation Request. This works great if your KMS Server is already in Production. However, if you are currently preparing a new KMS Server, you might want to channel your new clients to this dedicated KMS Server only.

Setting a static KMS Server manually

For configuring Volume Activation Tasks on a Windows Operating System, you have to use the Script “slmgr.vbs”, which can be found in “C:\Windows\system32”.

Running this Script with the Parameter “-skms” allows you, to set a static KMS Server and overwrite the value, that was retrieved using DNS. The following is an example, which sets the KMS Server to “KMS02.msitproblog.com”

"%WINDIR%\system32\slmgr.vbs" -skms KMS02.msitproblog.com

When done, you actually need to perform the Activation Request, using the following command:

"%WINDIR%\system32\slmgr.vbs" -ato

Modifying the ConfigMgr Task Sequence

Knowing the above commands, you can now start to integrate them into your OSD Task Sequence. I’ll do that on an example Task Sequence, which is deploying Windows 10 Enterprise.

Start by creating a new group “KMS Settings” somewhere after the Step “Setup Windows and Configuration Manager”.

KMS_TS_Part1

In this group, create a new “Run Command Line” Step, called “Set Static KMS Server”. Specify the following Command line

cscript //B "%windir%\system32\slmgr.vbs" -skms KMS02.msitproblog.com

Note: We’re calling the script here via cscript and the “//B” Parameter, which tells Windows Script Host to run the script in “Batch Mode” (-> Non Interactive)

Make sure to enable the Checkbox “Disable 64-bit file system redirection”. I had some weird issues, when the checkbox was un-ticked.

KMS_TS_Part3

Create again a new “Run Command Line” Step, called “Perform Activation Request”. Specify the following Command Line

cscript //B "%windir%\system32\slmgr.vbs" -ato

Make sure to again tick the Checkbox “Disable 64-bit file system redirection.

KMS_TS_Part4

That’s it. When you run the Task Sequence the next time, the specified KMS Settings will get applied.

Removing the static KMS Server

With the following command, you can configure your Client to remove the previously added “static” KMS Server and revert back, using the information from DNS.

"%WINDIR%\system32\slmgr.vbs" -ckms
5/5 - (1 vote)

2 Comments

  1. Biraja 5. March 2018
    • mm Simon Dettling 6. March 2018

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.