Add function to check LDAP availability

Mickaël Turnel
2022-02-11T09:33:32Z

(cherry picked from commit 7d749e05f6cbe1cbfcb8769b7275a9bf6da17023)