public static string ConvertUserPrincipalNameToNetBiosName(string userPrincipleName) { NameTranslate nameTranslate = new NameTranslate(); nameTranslate.Set((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_USER_PRINCIPAL_NAME, userPrincipleName); return(nameTranslate.Get((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_NT4)); }
public static string DistinguishedNameToDisplay(string dn) { var adTranslate = new NameTranslate(); adTranslate.Set((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_1779, dn); return(adTranslate.Get((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_DISPLAY)); }
public static string DistinguishedNameToUpn(string dn) { var adTranslate = new NameTranslate(); adTranslate.Set((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_1779, dn); return(adTranslate.Get((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_DOMAIN_SIMPLE)); }
public static string DistinguishedNameToCanonicalName(string dn) { var adTranslate = new NameTranslate(); adTranslate.Set((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_1779, dn); return(adTranslate.Get((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_CANONICAL)); }
public static string NetBiosName(DirectoryEntry entry) { var nameTranslate = new NameTranslate(); nameTranslate.Set( (int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_1779, entry.Properties["distinguishedName"].Value.ToString()); return(nameTranslate.Get((int)ADS_NAME_TYPE_ENUM.ADS_NAME_TYPE_NT4)); }