Поиск по Active Directory

Option Explicit    	     
On Error Resume Next 


Dim oQuery 
Dim objConnection 
Dim objCommand 
Dim objRecordSet 

oQuery = "<LDAP://dc=domain,dc=com>;;name;subtree"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"

Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection

objCommand.CommandText = oQuery
  
Set objRecordSet = objCommand.Execute

While Not objRecordSet.EOF
    Wscript.Echo objRecordSet.Fields("name")
    objRecordSet.MoveNext
Wend

objConnection.Close
Интересное на сайте: 
0
Голосов пока нет

Оставить комментарий