tencent cloud

Feedback

Activating Windows with slmgr Command

Last updated: 2022-04-13 11:01:52

    Overview

    This document describes how to activate the operating system in a Windows CVM instance.

    Note

    This document is intended only for Windows Server public images provided by Tencent Cloud. It is not applicable for custom images or images imported from external sources.

    Directions

    1. Log in to the Windows instance in the standard login method.
    2. Right-click in the bottom-left corner of the desktop and select Windows PowerShell (Administrator).
    3. In the PowerShell window, run the following commands in sequence to activate the operating system.
      slmgr /upk
      
    slmgr /ipk <ProductKey>
    
    slmgr /skms kms.tencentyun.com
    
    slmgr /ato
    

    <productkey> in the slmgr /ipk <productkey> command should be replaced as follows:

    • Windows Server 2008 R2 Enterprise: 489J6-VHDMP-X63PK-3K798-CPX3Y
    • Windows Server 2012 R2 Datacenter: W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
    • Windows Server 2016: CB7KF-BWN84-R7R2Y-793K2-8XDDG
    • Windows Server 2019: WMDGN-G9PQG-XVVXX-R3X43-63DFG
    1. Restart the CVM instance as instructed in Restarting Instances for the configuration to take effect.

    FAQs

    In some scenarios where the Windows operating system is not activated, the system memory of a high-end server will be limited to 2 GB, and the rest of the memory will be restricted in the form of "hardware reserved memory". The reason is that the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ProductOptions registry key is damaged. You can run the following command to determine whether to reactivate the system.

    (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\ProductOptions\).ProductPolicy.count
    
    • If the returned result is above 10,000, such as 56184, there is no need to reactivate the system.
    • If the returned result is "Unactivated value: 1960", refer to the following methods to solve the problem.
      1. Run the following command to activate the operating system.
        slmgr.vbs /ipk <ProductKey>
        

        Note

        Replace <productkey> according to the actual operating system version as detailed in ProductKey.

      2. After the command is executed, run the (Get-ItemProperty... command again for verification. The returned value is 56184.
      3. Restart the CVM instance as instructed in Restarting Instances for the configuration to take effect.
      4. Run the following command to activate the operating system.
        slmgr.vbs /ato
        

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support