How to configure a KMS server in Windows Server 2008 R2

Well I have had the pleasure of setting up a KMS server in our environment, and found that the documentation from Microsoft is somewhat confusing. In light of this I will write the steps I used to configure the first KMS server in our organisation for use with Windows Server, Windows client and Microsoft Office activation. These steps will only include the installation of 1 KMS server.

Installing first KMS Server

Below are the steps I used to install the KMS server. We determined that due to the number of client activations, and the capacity of our infrastructure we had no problems installing this server on our secondary domain controller. From here on we will call it DC2.

  1. Log onto https://www.microsoft.com/licensing/servicecenter/ and fetch your key: “Win Srv 2008 R2 Data Ctr/Itan KMS C” – Note your key may be similar, but either way it must end in either KMS B, or KMS C.
  2. On DC2 we run CMD with elevation
  3. Type slmgr /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx where the last section is the Key from your volume licensing website.
  4. Open “Windows Firewall with Advanced Security” via Start menu -> Administrative Tools.
  5. Under Inbound Rules scroll down to “Key Management Service (TCP-In)”, right click and select enable.
  6. Reboot the machine – note you can restart the Software Licensing service but I preferred to reboot it (seeing as the server was not in use for anything else)
    [code]net stop sppsvc && net start sppsvc[/code]
  7. Activate server after reboot. This can be done via the GUI or by executing the following command from an elevated command prompt:
    [code]slmgr.vbs /ato[/code]
  8. Enables automatic DNS publishing by the KMS host by entering the below command in an elevated command promt. Note this should already be enabled, but just in case, we execute the command.
    [code]slmgr /sdns[/code]

Now you are done installing your KMS server.Note this will provide activation for clients and/or servers depending on the KMS key you used to activate DC2. Office KMS activation will be covered in a later section.

I do recommend verifying that the SRV record in DNS is created. Note that you should have no problems with the automatic creation if you are using the vanilla install of AD and have no specific security restrictions in DNS. To verify that the DNS record has been created open up DNS and check. Refer to the screenshot below to see where it lives:

Installing Office KMS Host

As mentioned above we have determined that the one KMS box (DC2) is suitable to do all of our activations for Microsoft products, so now we have to configure the Office KMS host on DC2. To do this we do the following:

  1. Log onto https://www.microsoft.com/licensing/servicecenter/ and fetch your key: “Office 2010 Suites and Apps KMS” – Note your key may be similar. If unsure speak to your Microsoft Account Manager.
  2. Download the Office 2010 KMS Host License Pack from the Microsoft website: http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=97b7b710-6831-4ce5-9ff5-fdc21fe8d965. Its only 903kb so wont take too long.
  3. Execute KeyManagementServiceHost.exe from your existing KMS server> In our case its DC2. Follow the prompt to finish the setup process.
  4. When prompted enter the KMS key for Office 2010.

Thats it. Just as easy to setup. Now you are ready to activate Office 2010 with KMS. To help monitor this, please refer the the section below.

Administering the KMS server

I take it now you want to see whether it works and if clients can be activated. Now i will go into administering the KMS server, which will be quite brief as there is not much to it, and is really only there to aid in troubleshooting, and to have a sticky beak when implementing it. Once its running there is no real reason to keep going in and checking up on it.

All functions to view settings and make changes are done through the already used VBS script slmgr.vbs. To see all the commands simply run slmgr from the command prompt. Note to execute changes you will need elevated command prompt. You will see the following screens:

So the most common command that i used were:

Displays license information (KMS Activation Count)

[code]cscript slmgr.vbs /dli[/code]

Displays detailed license information

[code]cscript slmgr.vbs /dlv all[/code]

For Office specific information you can run the below command to get the info wanted:

[code]cscript slmgr.vbs /dlv bfe7a195-4f8f-4f0b-a622-cf13c7d16864[/code]

Note I add cscript to the front of the command so that the output stays within the command window, this lets me output/scroll if there is a lot of data where as the usual vbs dialog crops the output.

Configuring KMS Clients

By default, Volume Licensing edition of Windows Vista, Windows 7 , Windows Server 2008, and Windows Server 2008 R2 are KMS clients. If the computers the organisation wants to activate using KMS are using any of these operating systems and the network allows DNS auto-discovery, no further configuration is needed.

If required you can configure the KMS client to connect to a specific KMS host, use a specific port and disable KMS auto-discovery.

When deploying KMS clients using WAIK you can use 2 different methods to prepare the client:

  • SYSPREP – run Sysprep /generalize which will reset the activation timer along with removing SID and a few other settings. Read about this before actually using it.
  • Software License Manager – run slmgr.vbs /rearm in an elevated command prompt to reset the grace period back to 30 days. Note you can only perform this 3 times in total.

You can also manually force activation of the client by using the GUI from Control Panel -> System or by running slmgr /ato.

If you want to convert MAK installations of Windows or Office to KMS, you need to change their product key, and then reactivate. Use the below keys to perform this:

Operating system edition Product key
Windows 7
Windows 7 Professional FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
Windows 7 Professional N MRPKT-YTG23-K7D7T-X2JMM-QY7MG
Windows 7 Enterprise 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
Windows 7 Enterprise N YDRBP-3D83W-TY26F-D46B2-XCKRJ
Windows Server 2008 R2
Windows Server 2008 R2 HPC Edition FKJQ8-TMCVP-FRMR7-4WR42-3JCD7
Windows Server 2008 R2 Datacenter 74YFP-3QFB3-KQT8W-PMXWJ-7M648
Windows Server 2008 R2 Enterprise 489J6-VHDMP-X63PK-3K798-CPX3Y
Windows Server 2008 R2 for Itanium-Based Systems GT63C-RJFQ3-4GMB6-BRFB9-CB83V
Windows Server 2008 R2 Standard YC6KT-GKW9T-YTKYR-T4X34-R7VHC
Windows Web Server 2008 R2 6TPJF-RBVHG-WBW2R-86QPH-6RTM4
Office 2010 Suites
Office Professional Plus 2010 VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
Office Standard 2010 V7QKV-4XVVR-XYV4D-F7DFM-8R6BM
Office Home and Business 2010 D6QFG-VBYP2-XQHM7-J97RH-VVRCK
Office 2010 Stand-alone products
Access 2010 V7Y44-9T38C-R2VJK-666HK-T7DDX
Excel 2010 H62QG-HXVKF-PP4HP-66KMR-CW9BM
SharePoint Workspace 2010 QYYW6-QP4CB-MBV6G-HYMCJ-4T3J4
InfoPath 2010 K96W8-67RPQ-62T9Y-J8FQJ-BT37T
OneNote 2010 Q4Y4M-RHWJM-PY37F-MTKWH-D3XHX
Outlook 2010 7YDC2-CWM8M-RRTJC-8MDVC-X3DWQ
PowerPoint 2010 RC8FX-88JRY-3PF7C-X8P67-P4VTT
Project Professional 2010 YGX6F-PGV49-PGW3J-9BTGG-VHKC6
Project Standard 2010 4HP3K-88W3F-W2K3D-6677X-F9PGB
Publisher 2010 BFK7F-9MYHM-V68C7-DRQ66-83YTP
Word 2010 HVHB3-C6FV7-KQX9W-YQG79-CRY7T
Visio 2010
Visio Premium 2010 D9DWC-HPYVV-JGF4P-BTWQB-WX8BJ
Visio Professional 2010 7MCW8-VRQVK-G677T-PDJCM-Q8TCP
Visio Standard 2010 767HD-QGMWX-8QTDB-9G3R2-KHFGJ

You can convert Windows and Office from MAC to KMS using the GUI available, or you can use the following commands:

Windows
To install a KMS key, type slmgr.vbs /ipk KmsKey at a command prompt.
To active online, type slmgr.vbs /ato at a command prompt.
To activate by using the telephone, type slui.exe 4 at a command prompt.

Office
To install a KMS key, type ospp.vbs /inpkey:KmsKey at a command prompt.
To active online, type ospp.vbs /act at a command prompt.

Important Links

Here are the resources that I got most of the information I needed.

38 thoughts on “How to configure a KMS server in Windows Server 2008 R2”

  1. What can be done about the following: when starting the KMS service it says, “the kmsservice on local computer started and then stopped. Some services stop automatically if they are not in use….”. The service won’t stay up so can use the system.

    Reply
    • I can try to help but please answer the following for me.
      1. Why do you need to use goo?
      2. What machines and over what type of network are you trying to activate your clients?
      3. Have you configured the kms server for any other activations?
      Cheers, Ivan

      Reply
      • i need to activate all client via group policy.
        my client in domain controlle windows server 2012 r 2
        i have KMS server and need to activate Windows 10 for VDI and MS-Office 2013
        How to i activate via group policy ?

        Reply
  2. I’ve just successfully set-up a new KMS Host on Windows Server 2012 R2, and added the license packs for Office2010 and Office2013. However, when I run slmgr /dlv for the Office products the ‘Remaining App rearm count’ and ‘Remaining SKU rearm count’ both show as ‘-1’. Why is this, what does it mean, and does it mean there is a problem?

    Reply
    • Hi Paul,
      For each of those products, what does the ‘license status’ say? It sounds like it has not been activated correctly.
      Can you send/post the results of cscript slmgr.vbs /dlv all to get more info?
      ivan

      Reply
    • H Paul,
      I had a look at your output file (didn’t add it as its very long) but i noticed a couple of differences between yours and mine (windows 2012 server). You have the following extra in your’s that i don’t:

      • Remaining SKU rearm count: -1
      • Product Key Channel: Volume:CSVLK

      This is definitely going to be due to you running Windows Server 2012 R2. I think something is not quite right as you have the following for your Server activations:
      Remaining Windows rearm count: 996
      Remaining SKU rearm count: 1001

      I would suggest contacting MS technical support (phone support) as they wont charge anything, and they can confirm the information for you with their internal references. I would be very interested in what they have to say. Note: When i logged a call with MS, they tried to spend 10 minutes fixing it over the phone with very mundane steps, but then they escalated the call and i had someone remotely investigate and fix my issues for me. Definitely recommend it.

      Cheers,
      Ivan

      Reply
  3. Hello Ivan.

    I have a many questions and I will go by part, but before that thanks you for this article in your blog, it works for me and searching and reading.
    ***EDITED TO REDUCE ENTRY***
    [code collapse=”true”]
    Before to run the scripts in the KMS host is enabled the KMS service through the firewall.

    I do the follow steps:

    with the Administrator Command Prompt

    1.

    C:\Windows\system32>cscript ospp.vbs /sethst:sdwv-kms01-dp
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Input Error: Can not find script file "C:\Windows\system32\ospp.vbs".

    C:\Windows\system32>

    2.

    C:\Program Files (x86)\Microsoft Office\Office14>cscript ospp.vbs /act
    Microsoft (R) Windows Script Host versión 5.8
    Copyright (C) Microsoft Corporation 1996-2006. Reservados todos los derechos.

    —Processing————————–
    —————————————
    Installed product key detected – attempting to activate the following product:
    SKU ID: 9da2a678-fb6b-4e67-ab84-60dd6a9c819a
    LICENSE NAME: Office 14, OfficeStandard-KMS_Client edition
    LICENSE DESCRIPTION: Office 14, VOLUME_KMSCLIENT channel
    Last 5 characters of installed product key: 8R6BM

    —————————————
    —————————————
    —Exiting—————————–

    3.

    C:\Program Files (x86)\Microsoft Office\Office14>cscript ospp.vbs /dstatus
    Microsoft (R) Windows Script Host versión 5.8
    Copyright (C) Microsoft Corporation 1996-2006. Reservados todos los derechos.

    —Processing————————–
    —————————————
    SKU ID: 9da2a678-fb6b-4e67-ab84-60dd6a9c819a
    LICENSE NAME: Office 14, OfficeStandard-KMS_Client edition
    LICENSE DESCRIPTION: Office 14, VOLUME_KMSCLIENT channel
    LICENSE STATUS: —LICENSED—
    ERROR CODE: 0 as licensed
    Last 5 characters of installed product key: 8R6BM
    REMAINING GRACE: 180 days (259200 minute(s) before expiring)
    —————————————
    —————————————
    —Exiting—————————–

    4.

    Microsoft Windows [Version 6.2.9200]
    (c) 2012 Microsoft Corporation. All rights reserved.

    C:\Windows\system32>cscript slmgr.vbs /dlv bfe7a195-4f8f-4f0b-a622-cf13c7d16864
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Software licensing service version: 6.2.9200.16384

    Name: Microsoft Office 2010, KMSHost edition
    Description: Microsoft Office 2010 KMS, VOLUME_KMS channel
    Activation ID: bfe7a195-4f8f-4f0b-a622-cf13c7d16864
    Application ID: 59a52881-a989-479d-af46-f275c6370663
    Extended PID: 05426-00096-201-519588-03-19466-9200.0000-2242013
    Installation ID: 003911831563850821127090543254118785418296495203192102
    Processor Certificate URL:
    Machine Certificate URL:
    Use License URL:
    Product Key Certificate URL:
    Partial Product Key: PBKD4
    License Status: Licensed
    Remaining Windows rearm count: 1000
    Trusted time: 12/08/2013 05:36:00 p.m.

    Key Management Service is enabled on this machine
    Current count: 10
    Listening on Port: 1688
    DNS publishing enabled
    KMS priority: Normal

    Key Management Service cumulative requests received from clients
    Total requests received: 34
    Failed requests received: 0
    Requests with License Status Unlicensed: 0
    Requests with License Status Licensed: 2
    Requests with License Status Initial grace period: 32
    Requests with License Status License expired or Hardware out of tolerance: 0

    Requests with License Status Non-genuine grace period: 0
    Requests with License Status Notification: 0

    C:\Windows\system32>

    So, I want to know. the follow.

    This the first time I installed a KMS server role on a Server 2012.

    My clients are windows 7 and 8 with MS Office 201o Standard.

    Question:

    How many Keys I can enter in my KMS Server, when I try to add (install) a new Key for MS Office 2013 shoe the follow message on my KMS Host Key <>

    If I select Yes I uninstall the Key for MS Office 2010, how many products Key I can have in this server.

    I want to add (install)

    MS Office 2010/2013 Standard

    MS Windows 8

    Total Keys = 3

    Installed = 1

    My dude is the follow:

    I can run by separated in different servers the services of KMS Host for every product?

    How can I run the 3 Products Keys on the same server.

    For activate both MS Office version and Windows 8.

    Thanks for read and all the help.

    Sincerly

    Carly M.

    ICT System Manager.
    [/code]

    Reply
  4. Top article.
    I don’t know why Microsoft don’t make it a feature in Server Manager.
    Pete Long’s article is very useful, but this shades it for me!

    Thanks
    CaptainG

    Reply
    • Hi Captain Grumpy,
      I too cant understand why it was not a feature in Windows Server 2008, thankfully they have included both Active Directory based Activation (ADBA) and KMS as features of the Windows Server 2012 server. I am transitioning to the new server soon so keep an eye out for my new article.
      Cheers,
      Ivan

      Reply
  5. Ivan,
    How do you add KMS keys if you have more than one KMS key? At my firm, we have 6 keys for 2008R2… Do we need to setup a seperate KMS server for each key?
    Thanks,
    Jim

    Reply
    • Hi Jim,

      The KMS key is used to activate a host running KMS with Microsoft activation server. Once activated this host can then activate an unlimited number of computers within your organisation.
      You can use the same KMS key to activate a total of 6 hosts running KMS, and each host can be activated a total of 10 times each.

      If you have multiple KMS keys (like we do) due to Enterprise Agreement renewals or similar situations then you only need to use the most current KMS key available, although every single one of them will work.
      If you have multiple KMS keys because you have multiple Enterprise Agreements and multiple enterprises that needs activating (and they are all on the same network) then im not sure how you got yourself into this scenario, and i also dont beleive its supported.

      Hope this answers your questions,
      Ivan

      Reply
      • Ivan,
        I believe you have help very much. Thank you for your prompt response. The Keys are divided by MAK and KMS. I supposed as we move towards a more KMS centric process of activation, we will no longer need the MAK keys. Thanks for the info.
        Jim

        Reply
  6. This is an example how MS should post a document on KMS. Everything I have seen from MS was to long to read and keep my attention. Thank you for the step by step instructions, perfectly writen and leaves out all the guess work.

    Something worth adding, if you are moving your KMS server what additional steps need to be taken to remove KMS from the old server.

    Regards,
    Doug

    Reply
  7. Hey, thanks for the great post. Helped out a lot.

    In my case, I *only* wanted to do an Office 2010 KMS host. I didn’t care (at least for now) about KMS for OS or servers.

    So I just downloaded and ran the Office 2010 KMS Host License Pack software from link above on a 2008R2 server, entered my Office 2010 KMS key when prompted during install, and it did everything for me except add the firewall rule.

    In other words, I never had a KMS at this site before, just ran that program, and was good to go. Even the DNS was configured by it correctly.

    Reply
    • Hi Weave,
      Thanks for the comment – I’m sure it will help others with similar requirements. I may sticky it to the bottom of the article when I get some time.
      Ivan

      Reply
  8. You claim – How to configure a KMS server in Windows Server 2008 R2, but you fail to say where to download the KMS server installation or how to actually install it. So how about it, put a link on where to get the bloody thing.

    Reply
    • Hi Chuck,
      Sorry if the steps were not clear enough for you but I assure you that configuring KMS on a Windows 2008 R2 server is very much possible by following my article.
      The steps under heading “Installing first KMS Server” provides the steps to install it. There is no download as such because KMS ships with the product.
      If you type slmgr from a command prompt you will find that all the available options in configuring KMS are presented in several scripted windows.

      Sorry if the document was not clear. If time allows I will update the first section to include more information so there is no confusion in the future.
      NOTE: Office does have an installation, and the link and steps were provided.
      Kind Regards,
      Ivan

      Reply
      • chuck, in future, before you get on your “high” horse… first acquire proper product knowledge before you crit… Great work IVAN!!!!!

        Reply

Leave a Reply to naveenCancel reply

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

QR Code Business Card