Intermittent summarization errors with DirectorySearcher

I am using DirectorySearcher

to find user accounts based on email addresses:

using (var searcher = new DirectorySearcher
{
    SearchRoot = new DirectoryEntry($"LDAP://DC={companyOfficeLocation},DC={companyDomain},DC=com"),
    SearchScope = SearchScope.Subtree,
    Filter = $"(mail={email})",
    PropertiesToLoad = { "sAMAccountName" },
    ReferralChasing = ReferralChasingOption.All,
})
{
    return searcher.FindAll().Cast<SearchResult>()
        .Select(r => (string)r.Properties["sAMAccountName"][0])
        .ToList();
}

      

This code is interrupted with System.DirectoryServices.DirectoryServicesCOMException

an error message A referral was returned from the server.

.

These errors are inconsistent between machines (for example, on different web servers, the same request may fail or succeed in the same timeframe). There are some indications that restarting the Active Directory server or restarting the web server may cause errors.

I'm wondering: what are the possible causes of referral errors? Why do I see referral errors even though the property ReferralChasing

matters All

?

EDIT:

A bit more information from the property ExtendedErrorMessage

DirectoryServicesCOMException

:

0000202B: RefErr: DSID-031007F3, data 0, 1 access point ref 1: 'arlington.predictivetechnologies.com'

+3
c # .net active-directory ldap directorysearcher


source to share


No one has answered this question yet

See similar questions:

18
"The fix was sent from the server" when accessing AD from C #

or similar:

683
Error - Unable to access the IIS metabase
6
Why does LDAP authentication with DirectoryEntry intermittently throw COMException (0x8007203A): "Server is down"?
3
How to check for service unavailability and HTTP error
1
Random LDAP queries
0
NTLMv1 authentication fails over LDAP (SASL / GSS-SPNEGO)
0
Ambari server LDAP setupp error
0
Error 0x80005000 with LdapConnection and LDAPS
0
How do I create a DirectoryEntry with both a specific domain controller and a SID for a user or group?
0
C # netcore ldap authentication using Novell.Directory.Ldap.NETStandard library
0
AD FQDN from Partial



All Articles
Loading...
X
Show
Funny
Dev
Pics