如何使用 PowerShell 轉移或擷取 Active Directory FSMO 角色

Summary: 本文說明如何使用 Move-ADDirectoryServerOperationMasterRole PowerShell 命令,轉移或取得彈性單一 Mstr Operations (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 模組的加入網域的伺服器或工作站上執行。有兩個關鍵參數必須提供給此命令:身分識別OperationMasterRole

Identity 參數指定目標 DC - 即將將角色移動到的 DC。(無需指定源 DC,因為角色持有者資訊存儲在 AD 中。這通常是目標 DC 的主機名,但也可以是完全限定的功能變數名稱、可分辨名稱或 GUID。

操作主角色參數指定要移動的一個或多個角色。此參數的可能值為 PDCEmulatorRIDMasterInfrastructureMasterSchemaMasterDomainNamingMaster,但每種參數也有數字快捷方式:
 
0: PDCEmulator
1:RIDMaster
2:InfrastructureMaster
3:SchemaMaster
4:DomainNameMaster

這就是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.