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!