本文介绍 dcpromo 应答文件用于在域控制器上安装和删除 Active Directory 域服务 (AD DS) 的参数和选项。 您可以使用此信息生成应答文件,以便在域控制器上执行 AD DS 的无人参与安装。 还可以使用应答文件在无人参与模式下删除 AD DS。
DCPROMO 摘要
Dcpromo.exe 是一个可用于提升和降级 Active Directory 域控制器的程序。 管理员可以使用 dcpromo 应答文件执行以下无人值守任务:
- 将工作组和成员服务器升级到 Active Directory 域控制器。
- 将 Microsoft Windows NT 4.0 域控制器升级到 Active Directory 域控制器。
- 降级域控制器。
Windows Server 2000 及更高版本支持 dcpromo 应答文件语法。 但是,虽然 Windows Server 2012 及更高版本仍支持 dcpromo 应答文件语法,但它们将 dcpromo.exe 替换为 PowerShell cmdlet。 有关详细信息,请参阅 Active Directory PowerShell 模块参考。
基本语法
dcpromo 应答文件是一个 ASCII 文本文件,它为 Active Directory 域服务配置向导的每一页提供自动用户输入。
要在无人参与模式下启动 dcpromo
,请转到 “开始”,输入 dcpromo,然后在提升的命令提示符窗口中运行以下命令:
dcpromo /answer:<answer.txt>
注释
在此示例命令中, <answer.txt>
是您计划用于降级或升级的应答文件的路径和文件名的占位符。
每个 dcpromo作都需要对应答文件的 [DCInstall] 部分中特定字段的答案。 以下列表提供了每个作的必填字段。 如果未指定选项,则使用默认值。 这些字段的默认值在 字段定义 中进行了介绍。
对于新的林安装,以下选项适用:
[DCINSTALL] InstallDNS=yes NewDomain=forest NewDomainDNSName=\<The fully qualified Domain Name System (DNS) name> DomainNetBiosName=\<By default, the first label of the fully qualified DNS name> SiteName=\<Default-First-Site-Name> ReplicaOrNewDomain=domain ForestLevel=\<The forest functional level number> DomainLevel=\<The domain functional level number> DatabasePath="\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" RebootOnCompletion=yes SYSVOLPath="\<The path of a folder on a local volume>" SafeModeAdminPassword=\<The password for an offline administrator account>
对于子域安装,以下选项适用:
[DCINSTALL] ParentDomainDNSName=\<Fully qualified DNS name of parent domain> UserName=\<The administrative account in the parent domain> UserDomain=\<The name of the domain of the user account> Password=\<The password for the user account> Specify * to prompt the user for credentials during the installation. NewDomain=child ChildName=\<The single-label DNS name of the new domain> SiteName=\<The name of the AD DS site in which this domain controller will reside> This site must be created in advance in the Dssites.msc snap-in. DomainNetBiosName=\<The first label of the fully qualified DNS name> ReplicaOrNewDomain=domain DomainLevel=\<The domain functional level number> This value can't be less than the current value of the forest functional level. DatabasePath="\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" SYSVOLPath="\<The path of a folder on a local volume>" InstallDNS=yes CreateDNSDelegation=yes DNSDelegationUserName= \<The account that has permissions to create a DNS delegation> The account that is being used to install AD DS may differ from the account in the parent domain that has the permissions that are required to create a DNS delegation. In this case, specify the account that can create the DNS delegation for this parameter. Specify \* to prompt the user for credentials during the installation. DNSDelegationPassword= \<The password for the account that is specified for DNSDelegationUserName> Specify * to prompt the user for a password during the installation. SafeModeAdminPassword=\<The password for an offline administrator account> RebootOnCompletion=yes
对于现有林安装中的新树,以下选项适用:
[DCINSTALL] UserName=\<An administrative account in the parent domain> UserDomain=\<The name of the domain of the user account> Password=\<The password for the adminstrative account> Specify \* to prompt the user for credentials during the installation. NewDomain=tree NewDomainDNSName=\<The fully qualified DNS name of the new domain> SiteName=\<The name of the AD DS site in which this domain controller will reside> This site must be created in advance in the Dssites.msc snap-in. DomainNetBiosName=\<The first label of the fully qualified DNS name> ReplicaOrNewDomain=domain DomainLevel=\<The domain functional level number> DatabasePath="\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" SYSVOLPath="\<The path of a folder on a local volume>" InstallDNS=yes CreateDNSDelegation=yes DNSDelegationUserName= \<The account that has permissions to create a DNS delegation> The account that is being used to install AD DS may differ from the account in the parent domain that has the permissions that are required to create a DNS delegation. In this case, specify the account that can create the DNS delegation for this parameter. Specify \* to prompt the user for credentials during the installation. DNSDelegationPassword=\<The password for the account that is specified for DNSDelegationUserName> Specify * to prompt the user for a password during the installation. SafeModeAdminPassword=\<The password for an offline administrator account> RebootOnCompletion=yes
对于其他域控制器安装,以下选项适用:
[DCINSTALL] UserName=\<The administrative account in the domain of the new domain controller> UserDomain=\<The name of the domain of the new domain controller> Password=\<The password for the UserName account> SiteName=\<The name of the AD DS site in which this domain controller will reside> This site must be created in advance in the Dssites.msc snap-in. ReplicaOrNewDomain=replica ReplicaDomainDNSName=\<The fully qualified domain name (FQDN) of the domain in which you want to add an additional domain controller> DatabasePath="\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" SYSVOLPath="\<The path of a folder on a local volume>" InstallDNS=yes ConfirmGC=yes SafeModeAdminPassword=\<The password for an offline administrator account> RebootOnCompletion=yes
对于使用从介质安装 (IFM) 方法的其他域控制器安装,以下选项适用:
[DCINSTALL] UserName=\<The administrative account in the domain of the new domain controller> Password=\<The password for the UserName account> UserDomain=\<The name of the domain of the UserName account> DatabasePath="\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" SYSVOLPath="\<The path of a folder on a local volume>" SafeModeAdminPassword=\<The password of an offline administrator account> CriticalReplicationOnly=no SiteName=\<The name of the AD DS site in which this domain controller will reside> This site must be created in advance in the Dssites.msc snap-in. ReplicaOrNewDomain=replica ReplicaDomainDNSName=\<The fully qualified domain name (FQDN) of the domain in which you want to add an additional domain controller> ReplicationSourceDC=\<An existing domain controller in the domain> ReplicationSourcePath=\<The local drive and the path of the backup> RebootOnCompletion=yes
对于只读域控制器 (RODC) 安装,以下选项适用:
[DCINSTALL] UserName=\<The administrative account in the domain of the new domain controller> UserDomain=\<The name of the domain of the user account> PasswordReplicationDenied=\<The names of the user, group, and computer accounts whose passwords are not to be replicated to this RODC> PasswordReplicationAllowed =\<The names of the user, group, and computer accounts whose passwords can be replicated to this RODC> DelegatedAdmin=\<The user or group account name that will install and administer the RODC> SiteName=Default-First-Site-Name CreateDNSDelegation=no CriticalReplicationOnly=yes Password=\<The password for the UserName account> ReplicaOrNewDomain=ReadOnlyReplica ReplicaDomainDNSName=\<The FQDN of the domain in which you want to add an additional domain controller> DatabasePath= "\<The path of a folder on a local volume>" LogPath="\<The path of a folder on a local volume>" SYSVOLPath="\<The path of a folder on a local volume>" InstallDNS=yes ConfirmGC=yes SafeModeAdminPassword=\<The password for an offline administrator account> RebootOnCompletion=yes
对于删除 AD DS,以下选项适用:
[DCINSTALL] UserName=\<An administrative account in the domain> UserDomain=\<The domain name of the administrative account> Password=\<The password for the UserName account> AdministratorPassword=\<The local administrator password for the server> RemoveApplicationPartitions=yes RemoveDNSDelegation=yes DNSDelegationUserName=\<The DNS server administrative account for the DNS zone that contains the DNS delegation> DNSDelegationPassword=\<The password for the DNSDelegationUserName account> RebootOnCompletion=yes
要从域中的最后一个域控制器中删除 AD DS,以下选项适用:
[DCINSTALL] UserName=\<An administrative account in the parent domain> UserDomain=\<The domain name of the UserName account> Password=\<The password for the UserName account> Specify * to prompt the user for credentials during the installation. IsLastDCInDomain=yes AdministratorPassword=\<The local administrator password for the server> RemoveApplicationPartitions=If you want to remove the partitions, specify "yes" (no quotation marks) for this entry. If you want to keep the partitions, this entry is optional. RemoveDNSDelegation=yes DNSDelegationUserName=\<The DNS server administrative account for the DNS zone that contains the DNS delegation> DNSDelegationPassword=\<The password for the DNS server administrative account> RebootOnCompletion=yes
要删除林中的最后一个域控制器,以下选项适用:
[DCINSTALL] UserName=\<An administrative account in the parent domain> UserDomain=\<The domain name of the UserName account> Password=\<The password for the UserName account> Specify * to prompt the user for credentials during the installation. IsLastDCInDomain=yes AdministratorPassword=\<The local administrator password for the server> RemoveApplicationPartitions=If you want to remove the partitions, specify "yes" (no quotation marks) for this entry. If you want to keep the partitions, this entry is optional. RemoveDNSDelegation=yes DNSDelegationUserName=\<The DNS server administrative account for the DNS zone that contains the DNS delegation> DNSDelegationPassword=\<The password for the DNS server administrative account> RebootOnCompletion=yes
字段定义
本节介绍可在应答文件中使用的字段和条目。
安装运行参数
参数 | 默认值 | DESCRIPTION |
---|---|---|
AllowDomain重新安装 | 是 |不 | 此条目指定现有域是否为重新创建的域。 |
AllowDomainController重新安装 | 是 |不 | 此条目指定是否继续安装此域控制器,即使服务检测到使用相同名称的活动域控制器帐户。 仅当您确定现有账户不再处于活动状态时,才指定 Yes (是 )。 |
ApplicationPartitionsToReplicate | 无默认值 | 此条目指定必须以 格式 "partition1 partition2" 复制的应用程序分区。 如果指定 *,则服务将复制所有应用程序分区。 使用空格分隔或逗号和空格分隔的专有名称。 将整个字符串括在引号中。 |
ChildName (孩子名称) | 无默认值 | 这是附加到 ParentDomainDNSName 条目的从属域的名称。 如果父域为 A.COM 且从属域为 B,请输入 B.A.COM and B ChildName。 |
确认Gc | 是 |不 | 此条目指定副本是否也是全局目录。 Yes (是) 如果备份是全局编录,则使副本成为全局编录。 否 不会使副本成为全局目录。 这些条目不需要引号。 |
CreateDNSDelegation | 是 |否,无默认值 | 此条目指示是否创建引用此新 DNS 服务器的 DNS 委托。 此条目仅对 AD DS 集成的 DNS 有效。 |
CriticalReplicationOnly | 是 |不 | 此条目指定安装作在重新启动之前是否仅执行重要复制,然后跳过复制的非关键部分以节省时间。 非关键复制在角色安装完成后进行,并且计算机重新启动。 |
数据库路径 | %systemroot%\\NTDS |
此条目是本地计算机硬盘上完全限定的非通用命名约定 (UNC) 目录的路径。 此目录托管 AD DS 数据库 (NTDS.DIT) 的 如果该目录存在,则它必须为空。 如果不存在,则此条目将创建它。 您选择用于存储目录的逻辑驱动器上的可用磁盘空间必须为 200 MB。 为了容纳舍入错误或域中的所有对象,可用磁盘空间可能必须更大。 为了获得最佳性能,请在专用硬盘上找到该目录。 |
委托管理员 | 无默认值 | 此条目指定安装和管理 RODC 的用户或组的名称。 如果没有指定的值,则只有 Domain Admins 组或 Enterprise Admins 组的成员才能安装和管理 RODC。 |
DNSDelegationPassword | <密码> | *,无默认值 | 此条目指定用于创建或删除 DNS 委派的用户帐户的密码。 指定 * 以提示用户输入凭据。 |
DNSDelegation用户名 | 无默认值 | 此条目指定服务在创建或删除 DNS 委托时使用的用户名。 如果您未指定值,则服务将使用您为安装或删除 DNS 委派的 AD DS 指定的账户凭据。 |
DNSOnNetwork 公司 | 是 |不 | 此条目指定 DNS 服务在网络上是否可用。 仅当此计算机的网络适配器未配置为使用 DNS 服务器的名称进行名称解析时,该服务才使用此条目。 指定 No 以指示此计算机上安装了 DNS 以进行名称解析。 否则,必须将网络适配器配置为首先使用 DNS 服务器名称。 |
域级别 | 0 |2 |3 |4 |5 |6 |7 |10、无默认 | 此项指定域功能级别。 此项基于在现有林中创建新域时林中存在的级别。 值说明如下所示: - 0 = Windows 2000 Server 本机模式 - 2 = Windows Server 2003 - 3 = Windows Server 2008 - 4 = Windows Server 2008 R2 - 5 = Windows Server 2012 - 6 = Windows Server 2012 R2 - 7 = Windows Server 2016 - 10 = Windows Server 2025 |
域NetbiosName | 无默认值 | 此条目是 AD DS 之前的客户端用于访问域的 NetBIOS 名称。 DomainNetbiosName 在网络上必须是唯一的。 |
ForestLevel (森林级别) | 0 |2 |3 |4 |5 |6 |7 |10 | 此条目指定在新林中创建新域时的林功能级别,如下所示: - 0 = Windows 2000 Server 本机模式 - 2 = Windows Server 2003 - 3 = Windows Server 2008 - 4 = Windows Server 2008 R2 - 5 = Windows Server 2012 - 6 = Windows Server 2012 R2 - 7 = Windows Server 2016 - 10 = Windows Server 2025 在现有林中安装新域控制器时,不得使用此条目。 ForestLevel 条目替换了 Windows Server 2003 中提供的 SetForestVersion 条目。 |
安装 DNS | 是 |否,默认值会根据作1 而变化。 | 此条目指定在 Active Directory 域服务安装向导检测到 DNS 动态更新协议不可用时,服务是否为新域配置 DNS。 如果向导检测到现有域的 DNS 服务器数量不足,则此条目也适用。 |
日志路径 | %systemroot%\\NTDS |
这是承载 AD DS 日志文件的本地计算机上硬盘上的完全限定的非 UNC 目录的路径。 如果该目录存在,则它必须为空。 如果它不存在,则服务将创建它。 |
新域 | 树 |儿童 |森林 | Tree 表示新域是现有林中新树的根。 Child 表示新域是现有域的子域。 Forest 表示新域是域树的新林中的第一个域。 |
NewDomainDNSName 域名 | 无默认值 | 此条目用于“现有林中的新树”或“新林”安装。 该值是未使用的 DNS 域。 |
父域DNSName | 无默认值 | 此条目指定子域安装的现有父 DNS 域的名称。 |
密码 | <密码> | *,无默认值 | 此条目指定与配置域控制器的用户帐户相对应的密码。 指定 * 以提示用户输入凭据。 为了保护,安装后将从应答文件中删除密码。 每次用户使用应答文件时,都必须重新定义密码。 |
PasswordReplicationAllowed | < > Security_Principal |NONE,无默认值 | 此条目指定其密码可复制到此 RODC 的计算机帐户和用户帐户的名称。 如果要将值留空,请指定 NONE。 默认情况下,此 RODC 上不会缓存任何用户凭据。 要指定多个安全主体,请多次添加该条目。 |
PasswordReplicationDenied | < > Security_Principal |没有 | 此条目指定其密码不会复制到 RODC 的用户、组和计算机帐户的名称。 如果您不想拒绝复制任何用户或计算机的凭证,请指定 NONE。 要指定多个安全主体,请多次添加该条目。 |
RebootOnCompletion 完成 | 是 |不 | 此条目指定在安装或删除 AD DS 后是否重新启动计算机,而不管作是否成功。 |
RebootOnSuccess | 是 |否 |NoAndNoPrompt要么 | 此条目指定在成功安装或删除 AD DS 后是否必须重新启动计算机。 始终需要重启才能完成 AD DS 角色的更改。 |
ReplicaDomainDNSName | 无默认值 | 此条目指定要在其中配置其他域控制器的域的 FQDN。 |
ReplicaOrNewDomain | 副本 |只读副本 |域 | 此条目仅用于新安装。 Domain 将服务器转换为新域的第一个域控制器。 ReadOnlyReplica 将服务器转换为 RODC。 Replica 将服务器转换为其他域控制器。 |
ReplicationSourceDC | 无默认值 | 此条目指定从中复制 AD DS 数据以创建新域控制器的合作伙伴域控制器的 FQDN。 |
ReplicationSourcePath (复制源路径) | 无默认值 | 此条目指定用于创建新域控制器的安装文件的位置。 |
SafeModeAdminPassword 安全模式管理员密码 | <密码> |NONE,无默认值 | 此条目提供用于目录服务还原模式的脱机管理员帐户的密码。 您不能指定空密码。 |
网站名称 | 默认优先Site-Name | 此条目指定安装新林时的站点名称。 对于新林,默认值为 Default-First-Site-Name . 对于所有其他方案,服务使用当前站点和林的子网配置选择站点。 |
跳过AutoConfigDNS | 无默认值 | 此条目适用于希望跳过客户端设置、转发器和根提示的自动配置的专家用户。 仅当服务器上已安装 DNS 服务器服务时,该条目才有效。 在这种情况下,您会收到一条通知,确认服务跳过了 DNS 的自动配置。 否则,服务将忽略此条目。 如果指定此开关,请确保在安装 AD DS 之前正确创建和配置区域,否则域控制器将无法按预期运行。 此条目不会跳过在父 DNS 区域中自动创建 DNS 委托。 要控制 DNS 委托创建,请使用 DNSDelegation 条目。 |
Syskey (系统键) | < > system_key |没有 | 此条目指定从中复制数据的媒体的系统密钥。 |
SYSVOLPath | %systemroot%\\SYSVOL |
此条目指定本地计算机硬盘上的完全限定的非 UNC 目录。 此目录将托管 AD DS 日志文件。 如果该目录已存在,则它必须为空。 如果尚不存在,则由服务创建它。 该目录必须位于使用 NTFS 5.0 文件系统格式化的分区上。 为了获得最佳性能,请将目录放在与作系统不同的物理硬盘上。 |
TransferIMRoleIfNeeded | 是 |不 | 此条目指定是否将基础结构主机角色转移到此域控制器。 如果域控制器当前托管在全局编录服务器上,并且您不打算将域控制器设为全局编录服务器,则此条目非常有用。 指定 Yes (是) 将基础设施主机角色转移到此域控制器。 如果指定 Yes,请确保同时指定 ConfirmGC=No 条目。 |
用户域 | 无默认值 | 此条目指定您计划用于在服务器上安装 AD DS 的用户帐户的域名。 |
UserName | 无默认值 | 此条目指定用于在服务器上安装 AD DS 的用户帐户名。 我们建议您以 format \<domain>\\<user_name> 指定账户凭证。 |
注释
1 对于新林,默认情况下会安装 DNS 服务器角色。 对于新树、新子域或副本,如果 Active Directory 域服务安装向导检测到现有 DNS 基础结构,则默认安装 DNS 服务器。 如果向导未检测到现有 DNS 基础设施,则默认情况下不会安装 DNS 服务器。
移除作参数
参数 | 默认值 | DESCRIPTION |
---|---|---|
管理员密码 | 无默认值 | 此条目用于指定从域控制器中删除 AD DS 时的本地管理员密码。 |
降级FSMO | 是 |不 | 此条目指示即使域控制器拥有作主机角色,是否也会发生强制删除。 |
DNSDelegationPassword | <密码> | *,无默认值 | 此条目指定您计划用于创建或删除 DNS 委托的用户账户的密码。 指定 * 以提示用户输入凭据。 |
DNSDelegation用户名 | 无默认值 | 此条目指定您计划在创建或删除 DNS 委派时使用的用户名。 如果未指定值,则服务将使用您为 AD DS 安装或 DNS 委派的 AD DS 删除指定的帐户凭据。 |
IgnoreIsLastDcInDomainMismatch | 是 |不 | 此条目指定当您指定 IsLastDCInDomain=Yes 条目或 Active Directory 域服务安装向导检测到域中有另一个活动域控制器时,是否继续从域控制器中删除 AD DS。 此条目也适用于您指定 IsLastDCInDomain=No 条目且向导无法联系域中任何其他域控制器的方案。 |
IgnoreIsLastDNSServerForZone | 是 |不 | 此条目指定是否继续删除 AD DS,即使域控制器是域控制器托管的一个或多个 AD DS 集成 DNS 区域的最后一个 DNS 服务器。 |
IsLastDCIn域 | 是 |不 | 此条目指定从中删除 AD DS 的域控制器是否是域中的最后一个域控制器。 |
密码 | <密码> | *,无默认值 | 此条目指定与您计划用于配置域控制器的用户帐户相对应的密码。 指定 * 以提示用户输入凭据。 为了保护,该服务会在您安装 AD DS 后从应答文件中删除密码。 每次有人使用应答文件时,都必须重新定义密码。 |
RebootOnCompletion 完成 | 是 |不 | 此条目指定在安装或删除 AD DS 后是否重新启动计算机,而不管作是否成功。 |
RebootOnSuccess | 是 |否 |NoAndNoPrompt要么 | 确定用户在成功安装或删除 AD DS 后是否必须重新启动计算机。 始终需要重启才能完成 AD DS 角色的更改。 |
RemoveApplicationPartitions | 是 |不 | 此条目指定在从域控制器中删除 AD DS 时是否删除应用程序分区。 指定 Yes 将删除域控制器上的应用程序分区。 指定 No 不会删除域控制器上的应用程序分区。 如果域控制器托管任何应用程序目录分区的最后一个副本,则必须手动确认需要删除这些分区。 |
删除 DNSDelegation | 是 |不 | 此条目指定是否从父 DNS 区域中删除指向此 DNS 服务器的 DNS 委托。 |
保留 DCMetadata | 是 |不 | 此条目指定在删除 AD DS 后是否在域中保留域控制器元数据,以便委派管理员可以从 RODC 中删除 AD DS。 |
用户域 | 无默认值 | 此条目指定您计划用于安装 AD DS 的用户账户的域名。 |
UserName | 无默认值 | 此条目指定您计划用于在服务器上安装 AD DS 的用户帐户名。 我们建议您以 format \<domain>\\<user_name> 指定账户凭证。 |
无人值守安装返回代码
完成基于 Windows Server 2008 的域控制器的无人值守安装后,Active Directory 域服务安装向导将返回成功或失败代码。 有关无人值守安装返回代码的更多信息,请参阅 无人值守安装返回代码。