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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }