Last active
August 14, 2020 13:25
-
-
Save tylerapplebaum/d33d7749f7c6d4c4c8f255ddc6b7792c to your computer and use it in GitHub Desktop.
Test LDAPS connection to AD DC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Test-LDAPS { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$True)] | |
[string]$ADServer | |
) | |
$LDAPS = "LDAP://" + $ADServer + ":636" | |
try { | |
$global:Connection = [ADSI]($LDAPS) | |
} | |
Catch { | |
} | |
If ($Connection.Path) { | |
Write-Host "Active Directory server correctly configured for SSL, test connection to $($LDAPS) completed." | |
} | |
Else { | |
Write-Host "Active Directory server not configured for SSL, test connection to $($LDAPS) did not work." | |
} | |
} # End Test-LDAPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment