Manually activate Windows
Complete the following based on the version of Windows Server that your instance uses and the Amazon EC2 configuration tool that's installed:
Windows Server 2016 or 2019
-
Verify that the latest version of EC2Launch v1 is installed.
-
Open PowerShell as an administrator.
-
Import the EC2Launch module:
Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"
-
Add the routes:
Add-Routes
-
Set the activation settings:
Set-ActivationSettings
-
Activate Windows:
slmgr /ato
Windows Server 2022 or instances with EC2Launch v2 installed
-
Verify that the latest version of EC2Launch v2 is installed.
Note: EC2Launch v2 is installed by default on instances that use Windows Server 2022. -
Open PowerShell as an administrator.
-
Restart EC2Launch v2:
Net Restart "Amazon EC2Launch"
Note: When EC2Launch v2 restarts, it automatically resets the OS-level routes.
-
If Windows doesn't activate, then check the network communication from the instance to the Microsoft KMS server.
-
Perform telnet from your Amazon EC2 instance to the Microsoft KMS servers , and then open PowerShell.
-
Run the following commands:
Test-netconnection 169.254.169.250 -Port 1688 Test-netconnection 169.254.169.251 -Port 1688
-
Confirm that the connection status output is TcpTestSuccessed=True. If the connection status output is False, then verify that the following registry keys have the correct Microsoft KMS values:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform KeyManagementServiceName - 169.254.169.250 KeyManagementServicePort - 1688
Note: You can also enter 169.254.169.251 as the KeyManagementServiceName value.
-
Repeat step 6. If the connection status output is False, then check the Amazon Time Sync Service on your Amazon EC2 instance