Python/ADSI Problem

  • Thread starter Ondrej Krajicek
  • Start date
O

Ondrej Krajicek

Hello,

I have problem with the following code:

rootdse = ldap.OpenDSObject(ROOTDSE_URL, USER_NAME, PASSWORD, opts)
nc = rootdse.Get("defaultNamingContext")
uri = "LDAP://%s/%s" % (SERVER_NAME, nc)
dc = ldap.OpenDSObject(uri, USER_NAME, PASSWORD, opts)
cnUsers = dc.GetObject("top", "Users") ## <-- exception is thrown here

The last line throws an exception:
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0,
-2147016654), None)

I've tried several variants, such as:
GetObject(None, "Users"),
GetObject("", "CN=Users"),
GetObject(u"", u"CN=Users")

with no success. Similar code in C++ works perfectly, i.e. the binding
URLs, flags, etc. seem to be correct.

Anything obvious I've missed?

Thanks,

Ondra
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top