2010-查看五大角色

在加入域的任意一台客户端或者服务器自己,双击运行vbs文件,便可显示五大角色的主控制器,如图所示:服务器

wKiom1d2CfyBIhV2AAA4d8k5bwU412.png-wh_50


vbs内容以下:ide

Set objRootDSE = GetObject("LDAP://rootDSE")spa

Dim textrest

' Schema Masterblog

Set objSchema = GetObject("LDAP://" & objRootDSE.Get("schemaNamingContext"))ip

strSchemaMaster = objSchema.Get("fSMORoleOwner")get

Set objNtds = GetObject("LDAP://" & strSchemaMaster)it

Set objComputer = GetObject(objNtds.Parent)io

text="Forest-wide Schema Master FSMO: " & objComputer.Name & vbCrLfast

Set objNtds = Nothing

Set objComputer = Nothing

' Domain Naming Master

Set objPartitions = GetObject("LDAP://CN=Partitions," & _

objRootDSE.Get("configurationNamingContext"))

strDomainNamingMaster = objPartitions.Get("fSMORoleOwner")

Set objNtds = GetObject("LDAP://" & strDomainNamingMaster)

Set objComputer = GetObject(objNtds.Parent)

text=text&"Forest-wide Domain Naming Master FSMO: " & objComputer.Name & vbCrLf

Set objNtds = Nothing

Set objComputer = Nothing

' PDC Emulator

Set objDomain = GetObject("LDAP://" & objRootDSE.Get("defaultNamingContext"))

strPdcEmulator = objDomain.Get("fSMORoleOwner")

Set objNtds = GetObject("LDAP://" & strPdcEmulator)

Set objComputer = GetObject(objNtds.Parent)

text=text&"Domain's PDC Emulator FSMO: " & objComputer.Name & vbCrLf

Set objNtds = Nothing

Set objComputer = Nothing

' RID Master

Set objRidManager = GetObject("LDAP://CN=RID Manager$,CN=System," & _

objRootDSE.Get("defaultNamingContext"))

strRidMaster = objRidManager.Get("fSMORoleOwner")

Set objNtds = GetObject("LDAP://" & strRidMaster)

Set objComputer = GetObject(objNtds.Parent)

text=text&"Domain's RID Master FSMO: " & objComputer.Name & vbCrLf

Set objNtds = Nothing

Set objComputer = Nothing

' Infrastructure Master

Set objInfrastructure = GetObject("LDAP://CN=Infrastructure," & _

objRootDSE.Get("defaultNamingContext"))

strInfrastructureMaster = objInfrastructure.Get("fSMORoleOwner")

Set objNtds = GetObject("LDAP://" & strInfrastructureMaster)

Set objComputer = GetObject(objNtds.Parent)

text=text&"Domain's Infrastructure Master FSMO: " & objComputer.Name & vbCrLf

WScript.Echo text

相关文章
相关标签/搜索