如何使用 PowerShell 转移或夺取 Active Directory FSMO 角色

Summary: 本文介绍如何使用 Move-ADDirectoryServerOperationMasterRole PowerShell 命令转移或占用灵活单 Mstr 操作 (FSMO) 角色。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

有多种方法可以在 Active Directory 域控制器、图形 AD 控制台、 ntdsutil 命令和 PowerShell。一次转移或占用多个角色时,PowerShell 可能是最快、最简单的方法。

Move-ADDirectoryServerMstrOperationRole此超链接会将您带往 Dell Technologies 之外的网站。 cmdlet 用于转移或占用 FSMO 角色。它可以直接在 DC 上运行,也可以在安装了 ActiveDirectory PowerShell 模块的已加入域的服务器或工作站上运行。必须为此命令提供两个关键参数:Identity OperationMasterRole

Identity 参数指定目标 DC,即要将一个或多个角色移动到的 DC。(无需指定源 DC,因为角色持有者信息存储在 AD 中。)这通常是目标 DC 的主机名,但也可以是完全限定的域名、可分辨名称或 GUID。

OperationMasterRole 参数指定要移动的一个或多个角色。此参数的可能值为 PDCEmulatorRIDMasterInfrastructureMasterSchemaMasterDomainNamingMaster,但其中每个值都有数字快捷方式:
 
0: PDCEmulator
1:RIDMaster
2:InfrastructureMaster
3:SchemaMaster
4:DomainNamingMaster

这就是 PowerShell 的速度和效率变得明显的地方。若要将所有五个 FSMO 角色转移到名为 NewDC 的 DC,请运行此 cmdlet:
Move-ADDirectoryServerOperationMasterRole -Identity NewDC -OperationMasterRole 0,1,2,3,4
默认情况下,PowerShell 会提示确认每个角色,但有一个“ 全部是 ”选项。

若要获取 FSMO 角色(仅当现有角色持有者永久脱机时才应执行此操作),请将 -Force 参数添加到 cmdlet。使用上面的示例,如果所有五个角色都由永久离线的 DC 担任,则它们都可以在 NewDC 上被占用,如下所示:
Move-ADDirectoryServerOperationMasterRole -Identity NewDC -OperationMasterRole 0,1,2,3,4 -Force
如您所见,此命令与上一个命令之间的唯一区别是 -Force 参数。系统会提示您输入每个角色,如上所述。角色扣押比角色转移需要更长的时间才能完成,因为在夺取角色之前会尝试正常转移任何角色。假设角色持有者没有响应,则在癫痫发作发生之前超时期限必须到期。出于这个原因,以这种方式抓住所有五个角色需要几分钟的时间。

此视频演示了该过程:

在 PowerShell 中转移和获取 FSMO 角色

持续时间:06:02
隐藏式字幕提供多种语言版本。使用 CC 图标以更改“隐藏式字幕”语言。

Affected Products

Microsoft Windows Server 2016, Microsoft Windows Server 2019, Microsoft Windows Server 2022, Microsoft Windows 2012 Server, Microsoft Windows 2012 Server R2
Article Properties
Article Number: 000193715
Article Type: How To
Last Modified: 10 Mar 2025
Version:  10
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.