AWS Windows server EC2 instance would not activate
Tried various fixes ultimately AWS support helped us resolve.
We recently set up an EC2 instance for a customer moving an application to AWS. The source AMI we had created was moved from a stagging subnet we had for testing. Once we moved the instance into production it would not activate. It was easy to fix once we got AWS support involved. AWS support pointed out that there are a couple of scripts on the instance that you can run to re-configure the settings based on the current subnet placement of the instance.
The scripts in question are components of EC2 Launch. We modified the configuration options to avoid the local admin password being reset unexpectedly. This script was located c:\ProgramData\Amazon\EC2-Windows\Launch\Config\LaunchConfig.json and we modified the "adminPasswordType" setting's to "DoNothing"
Next, we called initializeinstance.ps1 script from an administrative powershell prompt. For your reference that file is located at "c:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1. Now when we ran slmgr.vbs /ato it showed that the instance was activated.