Я проверяю пароль в Active Directory, используя следующий код.Запрос занимает 4 секунды.
Почему это так медленно?
DirectoryEntry searchRoot = new DirectoryEntry(
"LDAP://ldap.subdomain.com:636/cn=serviceaccount,OU=serviceaccounts,DC=domain,DC=internal",
username,
password,
AuthenticationTypes.Secure);
try
{
DirectorySearcher ds = new DirectorySearcher(searchRoot);
ds.FindOne();
// Success!
}
catch (Exception ex)
{
Response.Write(ex.Message);
// Failure
}