Binding to a different active directory ldap instance in Powershell

Question:

I am trying to connect to some independent LDAP stores (ADAM – Active Directory Application Mode) using a specific set of credentials to bind with, but having trouble working out the best way to do this. Here is an example which I had hoped would work:

This will get me:

I also tried:

which results:

I’ve tried a few variations with filter etc. Most of the documentation I can find on this just assumes that I’m connecting to ldap from within the same directory/am connecting with the correct user for the query.

If you’re familiar with Python’s ldap module, this is how I do it in that:

Any pointers on how to approach this? I can definitely connect via the various LDAP clients out there. I might need to explicitly specify authentication, but I’m not sure because there is so little information on querying from outside the domain.

Answer:

You can try this…I use it to connect to an OpenLDAP instance and it works well. Works against AD also so it should fit your needs. You’ll need to update the $basedn variable and the host/username ones.

Credit for most of this goes here..

http://mikemstech.blogspot.com/2013/03/searching-non-microsoft-ldap.html

Source:

Binding to a different active directory ldap instance in Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply