I am creating AMI based on hardened Window2012, this is the steps I did:
- change some local group policies
- run some scripts to install/uninstall some applications
- enable some windows features
- run ec2config.exe –sysprep to create ami
The problem I met is step 4: I can set administrator password in the EC2Config Setting UI by choose "Specify password" in the "image" tab, then click on "shutdown with sysprep", however I want to automate this step, and don't know how to do it.
I found C:\Program Files\Amazon\Ec2ConfigService\sysprep2008.xml is the answer file for sysprep, insert a node of Administrator user credential information to the UserAccounts section, then sysprep will use it as the administrator's password.