# EC2 Windows Server License Activation

> How to activate a Windows Server license after migrating an AMI from one AWS account to another

- Canonical URL: <https://carlossura.com/blog/ec2-windows-server-license-activation/>
- Author: Carlos Sura
- Published: 2026-02-24
- Tags: license, ec2, aws, windows, server

Recently, I moved an EC2 instance from one AWS account to another AWS account using a shared AMI. Everything booted up and seemed to work fine but the license. Windows Server just refused to activate on the new instance.

It turns out there are a few specific steps I needed to run to point the new instance to the correct AWS KMS servers for activation.

Open PowerShell as an Administrator and execute the following:

```
Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"
Add-Routes
Set-ActivationSettings
slmgr /ato
```

That's it!
