SEC-2071: Allow to provide a root DN different from the domain

This is an improvement to the current implementation to provide flexibility when the root DN doesn't match the domain and/or the userPrincipalName.