Answer the question
In order to leave comments, you need to log in
How to connect to an LDAP server via PowerShell?
Can you please tell me why when trying to connect to the LDAP server via PowerShell
$dn = [ADSI]"LDAP://192.168.121.11:389/O=SDKGARANT,C=RU"
$dn
При получении элемента "PSComputerName" произошло следующее исключение: "Произошла ошибка протокола.
"
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand
Answer the question
In order to leave comments, you need to log in
I understand that a lot of time has come, but perhaps someone else is relevant.
If we are talking about OpenLDAP, then I saw this on the Internet:
$path = 'LDAP://192.168.14.83:389/dc=domain,dc=ru'
$username = 'admin'
$password = 'password'
Try{
$root = [adsi]::new($path,$username,$password)
$searcher = [adsisearcher]$root
$searcher.findone()
}
Catch{
Write-Host "ERROR: $_"
}
Unix login and password must be .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question