System.DirectoryServices Namespace
https://docs.microsoft.com/en-us/dotnet/api/system.directoryservices?view=netframework-4.7
The System.DirectoryServices namespace provides easy access to Active Directory Domain Services from managed code.
The namespace contains two component classes, DirectoryEntry and DirectorySearcher, which use the Active Directory Services Interfaces (ADSI) technology.
ADSI is the set of interfaces that Microsoft provides as a flexible tool for working with a variety of network providers.
ADSI gives the administrator the ability to locate and manage resources on a network with relative ease, regardless of the size of the network.
Remarks
The classes in this namespace can be used with any of the Active Directory Domain Services service providers.
The current providers are: Internet Information Services (IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare Directory Service (NDS), and WinNT.
ADSI is a programmatic interface for Microsoft Active Directory Domain Services that enables your applications to interact with diverse directories on a network using a single interface.
Using ADSI, you can create applications that perform common tasks, such as backing up databases, accessing printers, and administering user accounts.
It is assumed that you have a general understanding of Active Directory Domain Services before using these classes.
For more information on Active Directory Domain Services, see the topics
Introduction to Active Directory Objects
and
Active Directory Technology Backgrounder
, as well as the following topics in the MSDN library at http://msdn.microsoft.com/library:
Active Directory Domain Services use a tree structure.
Each node in the tree contains a set of properties.
Use this namespace to traverse, search, and modify the tree, and read and write to the properties of a node.
The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy.
Use this class for binding to objects, reading properties, and updating attributes.
Together with helper classes, DirectoryEntry provides support for life-cycle management and navigation methods, including creating, deleting, renaming, moving a child node, and enumerating children.
Use the DirectorySearcher class to perform queries against the Active Directory Domain Services hierarchy. LDAP is the only system-supplied Active Directory Service Interfaces (ADSI) provider that supports searching.
A search of the Active Directory Domain Services hierarchy through DirectorySearcher returns instances of SearchResult, which are contained in an instance of the SearchResultCollection class.
Note: Many of the classes, methods, and properties in the System.DirectoryServices namespace use the LinkDemand code access security option.
This means that the code access security demand only occurs during just-in-time compilation and that the demand is performed only on the calling assembly and not up the entire call stack.
Because of this, callers should not pass objects that are created from this namespace at runtime to code that is not trusted.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2016-12-05 devenv.exe assert failure
2014-12-05 arp攻击的处理方法
2014-12-05 使用vs的时候,遇到这个:当前不会命中断点 还没有为该文档加载任何符号
2013-12-05 User-Defined Table Types 用户自定义表类型
2013-12-05 sql server 基础知识