c# DirectoryEntry LDAPS
2021-01-21 17:14
标签:when serve rap director cti power 脚本 creat set 参考地址: 1. 测试 LDAPS 网络连接 2. 运行 power shell 下载证书的脚本(修改 $domain 参数值): 3. 安装证书: 4. 代码中的 LDAP 连接字符串设置为 636 端口(LDAP 端口是 389,LDAPS 是 636) c# DirectoryEntry LDAPS 标签:when serve rap director cti power 脚本 creat set 原文地址:https://www.cnblogs.com/myesn/p/DirectoryEntry-LDAPS.html
https://stackoverflow.com/questions/54987776/ldap-connection-error-the-server-is-not-operational-when-connecting-to-port
Test-NetConnection ad.sipac.gov.cn -Port 636
$domain = "ad.sipac.gov.cn"
$webRequest = [Net.WebRequest]::Create("https://$($domain):636")
try { $webRequest.GetResponse() } catch {}
$cert = $webRequest.ServicePoint.Certificate
$bytes = $cert.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)
set-content -value $bytes -encoding byte -path "~\Downloads\$domain.cer"
双击根证书文件,点击安装 -> 本地计算机 -> 将所有的证书都放入下列存储 -> 选择“受信任的根证书颁发机构” 点确定 -> 下一步
"LDAP://ad.sipac.gov.cn:636/OU=bsyan,DC=sipac,DC=gov,DC=cn"
文章标题:c# DirectoryEntry LDAPS
文章链接:http://soscw.com/index.php/essay/45066.html