How to specify administrator password on Windows 2012 when Run Sysprep with the EC2Config Service

581 Views Asked by At

I am creating AMI based on hardened Window2012, this is the steps I did:

  1. change some local group policies
  2. run some scripts to install/uninstall some applications
  3. enable some windows features
  4. 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.

1

There are 1 best solutions below

0
On

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.