How can i get all user from Oracle Internet Directory using vbscript?
How can i get all user from Oracle Internet Directory using 开发者_运维知识库vbscript?
As far as I understand, OID is just another LDAP service so I assume it can be queried using code similar to this:
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
But changing LDAP://dc=test,dc=com
to what you need to use to bind to it properly.
精彩评论