大网数据广告活动
域与目录服务

Error when you demote a domain controller

· 52CE 我爱测

Resolves an issue where demoting a domain controller by using the Active Directory Installation wizard (Dcpromo.exe) fails.

This article provides a solution to an issue where demoting a domain controller by using the Active Directory Installation wizard (Dcpromo.exe) fails.

Original KB number:   282272

Symptoms

When you demote a Windows domain controller by using the Dcpromo.exe, you may receive the following error message:

This domain controller holds the last replica of the following application directory partitions:
DC=MSTAPI,DC= yourdomain,DC=com

Cause

This behavior can occur if you installed the domain controller by using the Configure Your Server wizard. When you use this wizard, it automatically creates a program partition or a non-domain naming context called DC=MSTAPI,DC= yourdomain,DC=com.

Resolution

If you created the partition by using the Configure Your Server wizard, and you used the default name of Mstapi, if this name is not in use, use the Tapicfg.exe tool to remove this name. To do so, run the following command, where <your_domain.com> is your domain DNS name:

tapicfg remove /directory:mstapi.<your_domain.com>

If the partition was created manually, or if it was created by using another program, you can remove it by using the Ntdsutil utility:

  1. Open a command prompt, and then type ntdsutil.

  2. From the Ntdsutil prompt, type partition management.

  3. In the Domain Management window, type connections.

  4. Type connect to server <yourservername>.

    After the binding message appears, you will have a successful connection to your server.

  5. In the Server Connections window, type quit.

  6. In the Domain Management window, type list. A list of the naming contexts on this server appears.

  7. To remove the application directory partition replica, type remove nc replica <ApplicationDirectoryPartition> <DomainController>.

  8. At the Ntdsutil prompt, type Q, and then press ENTER until you are returned to the CMD command prompt. You can now successfully demote this domain controller. You may have to restart this domain controller before you start the Active Directory Installation wizard again.

More information

Windows supports program naming contexts, also referred to as non-domain naming contexts. This feature allows the Microsoft Active Directory directory service to host dynamic data without impacting network performance by enabling you to control the scope of replication and placement of replicas. With Active Directory services, you can create a new type of naming context or partition, referred to as the application partition. This naming context can contain a hierarchy of any type of object except security principals (users, groups, and computers), and it can be configured to replicate to any set of domain controllers in the forest that are not necessarily all in the same domain.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。