Disco.Services.Interop.ActiveDirectory.ADDomainController.RetrieveDirectoryEntry C# (CSharp) Method

RetrieveDirectoryEntry() public method

public RetrieveDirectoryEntry ( string DistinguishedName, string LoadProperties = null ) : ADDirectoryEntry
DistinguishedName string
LoadProperties string
return ADDirectoryEntry
        public ADDirectoryEntry RetrieveDirectoryEntry(string DistinguishedName, string[] LoadProperties = null)
        {
            if (string.IsNullOrWhiteSpace(DistinguishedName))
                throw new ArgumentNullException("DistinguishedName");

            if (!DistinguishedName.EndsWith(this.Domain.DistinguishedName, StringComparison.OrdinalIgnoreCase))
                throw new ArgumentException(string.Format("The Distinguished Name ({0}) isn't a member of this domain [{1}]", DistinguishedName, this.Domain.Name), "DistinguishedName");

            var entry = new DirectoryEntry(string.Format(LdapPathTemplate, this.Name, ADHelpers.EscapeDistinguishedName(DistinguishedName)));

            if (LoadProperties != null)
                entry.RefreshCache(LoadProperties);

            return new ADDirectoryEntry(this.Domain, this, entry);
        }