csharp 找到AD默认的defaultNamingContext

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 找到AD默认的defaultNamingContext相关的知识,希望对你有一定的参考价值。

using System;
using System.Collections.Generic;
using System.DirectoryServices;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryEntry deRoot = new DirectoryEntry("LDAP://10.10.2.11/RootDSE","administrator","P@ssw0rd");

            if (deRoot != null)
            {
                string defaultNamingContext = deRoot.Properties["defaultNamingContext"].Value.ToString();
                Console.WriteLine(defaultNamingContext);
                Console.WriteLine("成功输出了");
            }
            else
            {
                Console.WriteLine("找不到");
            }
            Console.ReadKey();
        }
    }
}

以上是关于csharp 找到AD默认的defaultNamingContext的主要内容,如果未能解决你的问题,请参考以下文章

csharp 验证AD用户

csharp 从AD #exchange下载所有代理地址

csharp B5F09AD7-9F9D-412A-8A93-101896A92162

csharp 94c3fec5-43ae-4de6-b285-505a89ad25a8

csharp string KelimeBul(string cumle,int kelimeSirasi)adındabirmetottanımlanacaktır。 Metot a paramet

AD9PCB设计怎么添加元器件封装库?