0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ドメインコントローラーの降格に失敗した場合の対処

Last updated at Posted at 2023-03-29

備忘録的な意味合いとして雑に残しておきます。

エラー内容

ドメインコントローラー降格時に 「ディレクトリサービスで必須の構成情報が不足しているため、浮動単一マスター操作の役割に対する所有権を判断できません。」 というエラーが出ました。
FSMOの役割を強制的に移行した場合に起こるらしい。

環境はWindowsServer 2019
ドメインの機能レベル:WindowsServer 2016
フォレストの機能レベル:WindowsServer 2016
です。

解決方法

Microsoftが公開しているKnowlgeBase949257内のfixfsmo.vbsをデスクトップなどサーバー内の任意の場所に保存します。
コマンドプロンプトを開き以下のコマンドをそれぞれ入力します。

cscript fixfsmo.vbs DC=ForestDnsZones,DC=contoso,DC=com
cscript fixfsmo.vbs DC=DomainDnsZones,DC=contoso,DC=com

コマンド実行後に再度通常通りの手順でドメインコントローラーの降格を行えばエラーなく降格できるはずです。

『DC=contoso,DC=com』の部分はそれぞれの環境で異なります。
例えばドメイン名が sudare.local だった場合は「DC=sudare,DC=local」と書き換えましょう。

念のためfixfsmo.vbsのスクリプトを以下に記載しておきます。

fixfsmo.vbs
fixfsmo.vbs
'-------fixfsmo.vbs------------------
const ADS_NAME_INITTYPE_GC = 3
const ADS_NAME_TYPE_1779 = 1
const ADS_NAME_TYPE_CANONICAL = 2

set inArgs = WScript.Arguments

if (inArgs.Count = 1) then
    ' Assume the command line argument is the NDNC (in DN form) to use.
    NdncDN = inArgs(0)
Else
    Wscript.StdOut.Write "usage: cscript fixfsmo.vbs NdncDN"
End if

if (NdncDN <> "") then

    ' Convert the DN form of the NDNC into DNS dotted form.
    Set objTranslator = CreateObject("NameTranslate")
    objTranslator.Init ADS_NAME_INITTYPE_GC, ""
    objTranslator.Set ADS_NAME_TYPE_1779, NdncDN
    strDomainDNS = objTranslator.Get(ADS_NAME_TYPE_CANONICAL)
    strDomainDNS = Left(strDomainDNS, len(strDomainDNS)-1)

    Wscript.Echo "DNS name: " & strDomainDNS

    ' Find a domain controller that hosts this NDNC and that is online.
    set objRootDSE = GetObject("LDAP://" & strDomainDNS & "/RootDSE")
    strDnsHostName = objRootDSE.Get("dnsHostName")
    strDsServiceName = objRootDSE.Get("dsServiceName")
    Wscript.Echo "Using DC " & strDnsHostName

    ' Get the current infrastructure fsmo.
    strInfraDN = "CN=Infrastructure," & NdncDN
    set objInfra = GetObject("LDAP://" & strInfraDN)
    Wscript.Echo "infra fsmo is " & objInfra.fsmoroleowner

    ' If the current fsmo holder is deleted, set the fsmo holder to this domain controller.

    if (InStr(objInfra.fsmoroleowner, "\0ADEL:") > 0) then

        ' Set the fsmo holder to this domain controller.
        objInfra.Put "fSMORoleOwner",  strDsServiceName
        objInfra.SetInfo

        ' Read the fsmo holder back.
        set objInfra = GetObject("LDAP://" & strInfraDN)
        Wscript.Echo "infra fsmo changed to:" & objInfra.fsmoroleowner

    End if

End if
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?