当前位置:DOS资源站资料中心VBS脚本 → 验证计算机是否为全局编录服务器

验证计算机是否为全局编录服务器

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-4 3:49:47

strComputer = "atl-dc-01"

Const NTDSDSA_OPT_IS_GC = 1

Set objRootDSE = GetObject("LDAP://" & strComputer & "/rootDSE")

strDsServiceDN = objRootDSE.Get("dsServiceName")

Set objDsRoot  = GetObject("LDAP://" & strComputer & "/" & strDsServiceDN)

intOptions = objDsRoot.Get("options")

If intOptions And NTDSDSA_OPT_IS_GC Then

    WScript.Echo strComputer & " is a global catalog server."

Else

    Wscript.Echo strComputer & " is not a global catalog server."

End If