Skip to content

Instantly share code, notes, and snippets.

@tylerapplebaum
Last active August 14, 2020 13:25
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylerapplebaum/d33d7749f7c6d4c4c8f255ddc6b7792c to your computer and use it in GitHub Desktop.
Save tylerapplebaum/d33d7749f7c6d4c4c8f255ddc6b7792c to your computer and use it in GitHub Desktop.
Test LDAPS connection to AD DC
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