hello world

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

strComputer = "server"

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 & " 是全局编录服务器."
Else
Wscript.Echo strComputer & " 不是全局编录服务器."
End If

   欢迎加入QQ技术群聊:70539804

posted @ 2015-09-08 15:12  浩天四哥  阅读(418)  评论(0编辑  收藏  举报