Connection string to connect to Active Directory using LDAP

前端 未结 4 1018
不知归路
不知归路 2020-12-17 04:56

my system admin gave me this:

Domain : capp.net USER : capp\\dhr2

Pass : admin@12345

what will the connection string be?

I am very very new t

4条回答
  •  自闭症患者
    2020-12-17 05:48

    Whenever I've accessed AD from .net I've done the following:

    var directoryEntry = new DirectoryEntry("LDAP://capp.net");
    directoryEntry.Username = "capp\dhr2";
    directoryEntry.Password = "admin@12345";
    

    Then you can query "AD" using the DirectorySearcher.

    var directorySearcher = new DirectorySearcher(directoryEntry);
    

    ...

提交回复
热议问题