最近在客戶現場作Windwos 2008 R2 域升級到Windows 2012 R2域,當降級Windows 2008 R2域控制器時,遇到一個問題,降級沒法繼續,操做失敗緣由爲「目錄服務沒有必需的配置信息,而且不能決定新的浮動單主機操做角色的全部權」,具體錯誤以下圖:服務器
通過萬能的網絡幫助,終找到解決方法,使用fixfsmo.vbs腳本在服務器上運行如下命令可解決:網絡
cscript fixfsmo.vbs DC = ForestDnsZones,DC = contoso,DC = comdom
cscript fixfsmo.vbs DC = DomainDnsZones,DC = contoso,DC = comide
'-------fixfsmo.vbs------------------this
const ADS_NAME_INITTYPE_GC = 3rest
const ADS_NAME_TYPE_1779 = 1orm
const ADS_NAME_TYPE_CANONICAL = 2blog
set inArgs = WScript.Argumentsdns
if (inArgs.Count = 1) thenip
' 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