Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP

Status
Not open for further replies.

HornedOne

MIS
Mar 8, 2001
25
0
0
GB
Hi,
I'm trying to do some LDAP coding through VB6 and I don't seem to be getting anywhere.

I'm trying to get a list of recipients from an active directory. I'm using the following code to get to grips with the idea and I don't seem to be able to get it to work:

Dim RecipObj As IADs
Dim memberOf As Variant

Set RecipObj = GetObject("LDAP://systems-dc/o=Exchange/cn=recipients")
memberOf = RecipObj.Get("memberOf")

If IsArray(memberOf) Then 'User is on more than one DL
For Each member In memberOf
Debug.Print member
Next
Else
Debug.Print memberOf
End If

I pinched this off the MS Knowledge base but I'm not sure I'm using the GetObject function correctly. On the exchange site it also wants me to pass an "ou" parameter and two cn parameteres but I'm not sure what they are.

The error I get with this code is:

Run-time Error: -2147016672 (80072020)

Automation Error
An operations error occurred



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top