AdUsers.AdUserProvider.GetEntry C# (CSharp) Method

GetEntry() private method

private GetEntry ( string login ) : System.DirectoryServices.DirectoryEntry
login string
return System.DirectoryServices.DirectoryEntry
        private DirectoryEntry GetEntry(string login)
        {
            string filter = string.Format("(&(ObjectClass={0})(sAMAccountName={1}))", "person", login);

            string[] properties = new string[] { "fullname" };

            DirectoryEntry adRoot = new DirectoryEntry("LDAP://" + DOMAIN, null, null, AuthenticationTypes.Secure);
            DirectorySearcher searcher = new DirectorySearcher(adRoot);
            searcher.SearchScope = SearchScope.Subtree;
            searcher.ReferralChasing = ReferralChasingOption.All;
            searcher.PropertiesToLoad.AddRange(properties);
            searcher.Filter = filter;

            SearchResult result = searcher.FindOne();
            DirectoryEntry directoryEntry = result.GetDirectoryEntry();
            return directoryEntry;
        }