https://docs.microsoft.com/zh-cn/windows/win32/adsi/search-filter-syntax?redirectedfrom=MSDN

https://blog.csdn.net/bytxl/article/details/11556195

 

 // Create a new DirectorySearcher that starts at the root.
    // You can start it anywhere you want though
    //     by providing a value in the DirectoryEntry constructor.
    DirectorySearcher searcher = new DirectorySearcher(new DirectoryEntry());
 
// Set the scope to Subtree in order to search all children.
searcher.SearchScope = SearchScope.Subtree;
 
// Set the filter to only look for Organizational Units//     that have the name you are looking for.
searcher.Filter = "(&(objectClass=organizationalUnit)(name=" + ouName + "))";
 
// If you are looking for only one result then do the following two things.SearchResult results = searcher.FindOne();
this.Properties = results.GetDirectoryEntry();

相关文章:

  • 2021-04-07
  • 2021-06-14
  • 2022-12-23
  • 2021-06-29
  • 2021-07-04
  • 2021-05-23
  • 2021-11-23
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-07-17
  • 2021-06-16
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案