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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~