Connect to OpenLDAP Linux Server from Windows Powershell

0

My OpenLDAP server is setup in Linux. I want to connect to it from Windows 10 through Powershell This is the code snippet that I'm using

$path = 'LDAP://xxx.xxx.x.xxx:xxx/dc=xyz,dc=com'
$username = 'admin'
$password = 'password'
Try{
    $root = [adsi]::new($path,$username,$password)
    $searcher = [adsisearcher]$root
    $searcher.findone()
}
Catch{
    Write-Host "ERROR: $_"
}

I'm getting the following error -

ERROR: Exception calling "FindAll" with "0" argument(s): "Unknown error (0x80005000)"

My aim after connecting to the server is to perform the equivalent of 'ldapsearch' and retrieve the LDAP Password Policy setup in the OpenLDAP server.

powershell
openldap
asked on Stack Overflow Aug 20, 2018 by Ram Krishnan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0