LdapAdapter solution converted to .NET 4.5