1 2 3 4 5 6 7 8 9 10 11 |
$dc = [System.DirectoryServices.ActiveDirectory.Domain]::getCurrentDomain().DomainControllers | Select -First 1 $LDAPs = [ADSI]"LDAP://$($dc.name):636" try { $Connection = [adsi]($LDAPS) } Catch { } If ($Connection.Path) { Write-Host "Active Directory server correctly configured for SSL, test connection to $($LDAPS.Path) completed." } Else { Write-Host "Active Directory server not configured for SSL, test connection to LDAP://$($dc.name):636 did not work." } |