如何使用vbscript从Oracle Internet Directory获取所有用户?
答案 0 :(得分:0)
据我了解,OID只是另一个LDAP服务,因此我假设可以使用类似的代码查询它:
Const ADS_SCOPE_SUBTREE = 2
Set conn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
conn.Provider = "ADsDSOObject"
conn.Open "Active Directory Provider"
Set cmd.ActiveConnection = conn
cmd.Properties("Page Size") = 1000
cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE
cmd.CommandText = "SELECT Name FROM 'LDAP://dc=test,dc=com' WHERE objectCategory='user'"
Set rec = cmd.Execute
rec.MoveFirst
Do Until rec.EOF
Wscript.Echo rec.Fields("Name").Value
rec.MoveNext
Loop
但是将LDAP://dc=test,dc=com
更改为您需要用来正确绑定它的内容。