System.DirectoryServices.DirectoryServicesCOMException (0x8007202B): A referral was returned from the server

0

I am getting the exception (System.DirectoryServices.DirectoryServicesCOMException (0x8007202B): A referral was returned from the server.) while trying to read the manager's display name from Active Directory.

Exception Snapshot:

enter image description here

The exception is occurring while doing the following check,

if (grp != null && grp.Properties != null && grp.Properties["displayname"] != null && grp.Properties["displayname"].Value != null)

Code:

if (foundEntry.Properties["manager"] != null && foundEntry.Properties["manager"].Value != null)
{
    DirectoryEntry grp = new DirectoryEntry("LDAP://" + foundEntry.Properties["manager"].Value);
    if (grp != null && grp.Properties != null && grp.Properties["displayname"] != null && grp.Properties["displayname"].Value != null)
    {
        adresult.SupervisorName = grp.Properties["displayname"].Value.ToString();
    }
}

Group Property

When I debug grp.Properties, I am seeing the following:

enter image description here

Am I missing anything? What could be the cause of this issue?

I appreciate any suggestions.

c#
active-directory
asked on Stack Overflow Sep 11, 2015 by Vimalan Jaya Ganesh • edited Sep 11, 2015 by Vimalan Jaya Ganesh

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0