LDAP Binding with host and different x500 spec

David Zemdegs 1,596 Reputation points
2020-12-08T22:04:52.767+00:00

Greetings,
I have to do an LDAP search and all I have been given is the FQDN host name and the search root in the format OU=xxx,O=yyy,c=zz.

Does anyone know how to construct the directory entry using both of those?
Thanks
David z

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. David Zemdegs 1,596 Reputation points
    2020-12-09T00:18:52.313+00:00

    Its OK Ive worked it out:
    $Directory = New-Object DirectoryServices.DirectoryEntry("LDAP://<hostname>/<x500searchroot>","<x500account>","<password>")
    $searcher = New-Object System.DirectoryServices.DirectorySearcher
    $searcher.SearchRoot = $Directory


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.