windows2008无人值守安装域控制器

时间:2023-01-03 07:35:24

转自:https://blog.csdn.net/techviewer/article/details/26485017 

unattend.txt文件:

; DCPROMO unattend file (automatically generated by dcpromo)
; Usage:
; dcpromo.exe /unattend:C:\Users\Administrator\Desktop\.txt
;
[DCInstall]
; New forest promotion
ReplicaOrNewDomain=Domain
NewDomain=Forest
NewDomainDNSName=contoso.com
ForestLevel=
DomainNetbiosName=CONTOSO
DomainLevel=
InstallDNS=Yes
ConfirmGc=Yes
CreateDNSDelegation=No
DatabasePath="C:\Windows\NTDS"
LogPath="C:\Windows\NTDS"
SYSVOLPath="C:\Windows\SYSVOL"
; Set SafeModeAdminPassword to the correct value prior to using the unattend file SafeModeAdminPassword=
; Run-time flags (optional)
; RebootOnCompletion=Yes

主要注释:

dcpromo.exe /unattend:C:\Users\Administrator\Desktop\123.txt,这个是应答文件

NewDomainDNSName=contoso.com,新的DNS名称是“contoso.com”

ForestLevel=4,林功能级别是2008R2
InstallDNS=Yes,安装DNS服务
ConfirmGc=Yes,配置GC角色
CreateDNSDelegation=No,不创建DNS委派
DatabasePath="C:\Windows\NTDS",数据库文件路径
LogPath="C:\Windows\NTDS",日志文件路径
SYSVOLPath="C:\Windows\SYSVOL",SYSVOL路径

下面转自:http://www.pianshen.com/article/589051953/

windows2008无人值守安装域控制器

文件中已经说明了该文件的使用方法:

dcpromo.exe /unattend:“C:\Users\1234\Documents\Answer.txt”

使用命令行安装AD

windows server 2008不支持,因为它没有powershellR2是支持的
powershell中执行如下命令:

dcpromo /unattend /InstallDns:yes /newDomain:forest
/replicaOrNewDomain:domain /newDomainDnsName:sayms.com
/DomainNetbiosName:SAYMS /forestLevel: /domainLevel:
/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