Is there a way to get all Group or Users objects from Active Directory

B

Barmaley

I hope somebody knows answer here

I was NOT able to find newsgroups for ADS or LDAP coding.

I already have LDAP query that pull info if I specify exact attribute. But I
want to do partial searches etc

Here is what I have

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function Dist_Name(User_NAME)
strusername = User_NAME
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"

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

objCommand.CommandText = _
"<LDAP://dc=ggg,dc=gg,dc=ggg,dc=gg,dc=gg>;(&(objectCategory=User)" &
_
"(samAccountName=" & strusername &
"));distinguishedname;subtree"

Set objRecordSet = objCommand.Execute

If objRecordSet.RecordCount = 0 Then
Dist_Name= "Does Not Exist"
Else
Dist_Name= objRecordSet.Fields("distinguishedName")
End If

objConnection.Close
Set objConnection = Nothing
Set objCommand = Nothing
End Function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
D

Douglas J. Steele

Try microsoft.public.adsi.general

If that group isn't available to you, try connecting directly to
msnew.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top