转自:https://blog.csdn.net/techviewer/article/details/26485017
unattend.txt文件:
; DCPROMO unattend file (automatically generated by dcpromo) ; Usage: ; dcpromo.exe /unattend:C:UsersAdministratorDesktop123.txt ; [DCInstall] ; New forest promotion ReplicaOrNewDomain=Domain NewDomain=Forest NewDomainDNSName=contoso.com ForestLevel=4 DomainNetbiosName=CONTOSO DomainLevel=4 InstallDNS=Yes ConfirmGc=Yes CreateDNSDelegation=No DatabasePath="C:WindowsNTDS" LogPath="C:WindowsNTDS" SYSVOLPath="C:WindowsSYSVOL" ; Set SafeModeAdminPassword to the correct value prior to using the unattend file SafeModeAdminPassword= ; Run-time flags (optional) ; RebootOnCompletion=Yes
主要注释:
dcpromo.exe /unattend:C:UsersAdministratorDesktop123.txt,这个是应答文件
NewDomainDNSName=contoso.com,新的DNS名称是“contoso.com”
ForestLevel=4,林功能级别是2008R2
InstallDNS=Yes,安装DNS服务
ConfirmGc=Yes,配置GC角色
CreateDNSDelegation=No,不创建DNS委派
DatabasePath="C:WindowsNTDS",数据库文件路径
LogPath="C:WindowsNTDS",日志文件路径
SYSVOLPath="C:WindowsSYSVOL",SYSVOL路径
下面转自:http://www.pianshen.com/article/589051953/
文件中已经说明了该文件的使用方法:
dcpromo.exe /unattend:“C:Users1234DocumentsAnswer.txt”
使用命令行安装AD
windows server 2008
不支持,因为它没有powershell
,R2
是支持的
在powershell
中执行如下命令:
dcpromo /unattend /InstallDns:yes /newDomain:forest
/replicaOrNewDomain:domain /newDomainDnsName:sayms.com
/DomainNetbiosName:SAYMS /forestLevel:4 /domainLevel:4
/createDNSDelegation:no
/databasePath:"%SystemRoot%NTDS" /logPath:"%SystemRoot%NTDS" /sysvolpath:"%SystemRoot%SYSVOL"
/safeModeAdminPassword:v201303036.
/rebootOnCompletion:yes
其实和上面的应答文件差不多,注意,要写成一行,上面是为了易于查看才截开的
dcpromo /unattend /InstallDns:yes /newDomain:forest /replicaOrNewDomain:domain /newDomainDnsName:sayms.com /DomainNetbiosName:SAYMS /forestLevel:4 /domainLevel:4 /createDNSDelegation:no /databasePath:"%SystemRoot%NTDS" /logPath:"%SystemRoot%NTDS" /sysvolpath:"%SystemRoot%SYSVOL" /safeModeAdminPassword:v201303036. /rebootOnCompletion:yes
上面的应答文件安装和命令行安装都属于无人值守安装,在安装前应该切换为administrator
用户,把IP
设置为静态,首选DNS
服务器指向自己,计算机名更改为dc1