A. To use an answer file when promoting a DC using the install-from-media function, you must add the following two lines to your answer file:

ReplicateFromMedia=yes                              ReplicationSourcePath=c:\NTDSRestore

The second line must contain the path to the location of the DC backup restored files. For example, an answer file might look like

\[Unattended\]                              Unattendmode=fullunattended                              \[DCINSTALL\]                              UserName=<domain admin account>                              Password=<password for domain account>                              UserDomain=<domain name>                              DatabasePath=c:\windows\ntds                              LogPath=c:\windows\ntds                              SYSVOLPath=c:\windows\sysvol                              SafeModeAdminPassword=<new password for safe mode>                              CriticalReplicationOnly=No                              SiteName=<name of site for the domain controller>                              ReplicaOrNewDomain=Replica                              ReplicaDomainDNSName=<existing DNS domain name>                              ReplicationSourceDC=<existing domain controller in domain>                              ReplicateFromMedia=yes                              ReplicationSourcePath=c:\NTDSrestore                              RebootOnSuccess=yes

To use this answer file, enter the command

dcpromo /adv /answer:<filename>

Be aware that if you use an answer file for a second time to perform another unattended installation, the passwords will be blank and you'll be prompted to re-enter them. The Dcpromo process removes the passwords from the file each time for security reasons.