![]() |
VOOZH | about |
dotnet add package System.DirectoryServices --version 10.0.9
NuGet\Install-Package System.DirectoryServices -Version 10.0.9
<PackageReference Include="System.DirectoryServices" Version="10.0.9" />
<PackageVersion Include="System.DirectoryServices" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="System.DirectoryServices" />Project file
paket add System.DirectoryServices --version 10.0.9
#r "nuget: System.DirectoryServices, 10.0.9"
#:package System.DirectoryServices@10.0.9
#addin nuget:?package=System.DirectoryServices&version=10.0.9Install as a Cake Addin
#tool nuget:?package=System.DirectoryServices&version=10.0.9Install as a Cake Tool
Provides easy access to Active Directory Domain Services from managed code. Microsoft Active Directory Domain Services are the foundation for distributed networks built on Windows 2000 Server, Windows Server 2003 and Microsoft Windows Server 2008 operating systems that use domain controllers. 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.
Active Directory Domain Services use a tree structure. Each node in the tree contains a set of properties. Use this library to traverse, search, and modify the tree, and read and write to the properties of a node.
Install the System.DirectoryServices library from nuget
dotnet add package System.DirectoryServices --version 7.0.1
The sample needs a real path to an Active Directory server to work properly:
using System.DirectoryServices;
namespace TestDirectoryServices
{
internal class Program
{
static void Main(string[] args)
{
DirectoryEntry rootDse = new DirectoryEntry("LDAP://RootDSE");
string configNamingContext = rootDse.Properties["configurationNamingContext"].Value.ToString();
DirectoryEntry certTemplates = new DirectoryEntry("LDAP://CN=Certificate Templates,CN=Public Key Services,CN=Services," + configNamingContext);
DirectorySearcher templatesSearch = new DirectorySearcher(certTemplates, "(objectClass=pKICertificateTemplate)", null, SearchScope.OneLevel);
SearchResultCollection templates = templatesSearch.FindAll();
foreach (SearchResult template in templates)
{
Console.WriteLine($"Name: {template.Properties["name"][0]} ({template.Properties["displayName"][0]})");
Console.WriteLine($"Flags: {template.Properties["msPKI-Enrollment-Flag"][0]}");
}
}
}
}
The main types provided by this library are:
System.DirectoryServices.DirectoryEntrySystem.DirectoryServices.DirectorySearcherSystem.DirectoryServices is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on System.DirectoryServices:
| Package | Downloads |
|---|---|
|
System.DirectoryServices.AccountManagement
Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM). |
|
|
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard. |
|
|
System.Management.Automation
Runtime for hosting PowerShell |
|
|
CoreWCF.Primitives
CoreWCF is a port of the service side of Windows Communication Foundation (WCF) to .NET Core. The goal of this project is to enable existing WCF services to move to .NET Core. |
|
|
CoreWCF.Http
CoreWCF is a port of the service side of Windows Communication Foundation (WCF) to .NET Core. The goal of this project is to enable existing WCF services to move to .NET Core. |
Showing the top 20 popular GitHub repositories that depend on System.DirectoryServices:
| Repository | Stars |
|---|---|
|
PowerShell/PowerShell
PowerShell for every system!
|
|
|
opserver/Opserver
Stack Exchange's Monitoring System
|
|
|
netwrix/pingcastle
PingCastle - Get Active Directory Security at 80% in 20% of the time
|
|
|
exceptionless/Exceptionless
Exceptionless application
|
|
|
filoe/cscore
An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
|
|
|
googleprojectzero/sandbox-attacksurface-analysis-tools
Set of tools to analyze Windows sandboxes for exposed attack surface.
|
|
|
dahall/Vanara
A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers.
|
|
|
MichaelGrafnetter/DSInternals
Directory Services Internals (DSInternals) PowerShell Module and Framework
|
|
|
CoreWCF/CoreWCF
Main repository for the Core WCF project
|
|
|
ariacom/Seal-Report
Database Reporting Tool and Tasks (.Net)
|
|
|
wixtoolset/wix
WiX Toolset Code
|
|
|
unosquare/passcore
A self-service password management tool for Active Directory
|
|
|
p0dalirius/LDAPmonitor
Monitor creation, deletion and changes to LDAP objects live during your pentest or system administration!
|
|
|
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
|
|
|
kimmknight/raweb
A modern web interface for your RemoteApps hosted on Windows 10, 11 and Server.
|
|
|
Implem/Implem.Pleasanter
Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
|
|
|
CICADA8-Research/RemoteKrbRelay
Remote Kerberos Relay made easy! Advanced Kerberos Relay Framework
|
|
|
tomcarver16/ADSearch
A tool to help query AD via the LDAP protocol
|
|
|
DataDog/dd-trace-dotnet
.NET Client Library for Datadog APM
|
|
|
microsoft/WindowsProtocolTestSuites
⭐⭐ Join us at SambaXP for the SMB3 IO Lab (April 20-23, 2026), see upcoming Interoperability Events
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 1,026 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 2,161 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 3,242 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 3,376 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 3,958 | 2/10/2026 |
| 10.0.9 | 64,324 | 6/9/2026 |
| 10.0.8 | 337,266 | 5/12/2026 |
| 10.0.7 | 439,390 | 4/21/2026 |
| 10.0.6 | 166,945 | 4/14/2026 |
| 10.0.5 | 658,398 | 3/12/2026 |
| 10.0.4 | 56,083 | 3/10/2026 |
| 10.0.3 | 505,374 | 2/10/2026 |
| 10.0.2 | 569,336 | 1/13/2026 |
| 10.0.1 | 463,770 | 12/9/2025 |
| 9.0.17 | 5,629 | 6/9/2026 |
| 9.0.16 | 36,050 | 5/12/2026 |
| 9.0.15 | 93,612 | 4/14/2026 |
| 9.0.14 | 99,610 | 3/10/2026 |
| 9.0.13 | 61,329 | 2/10/2026 |
| 9.0.12 | 81,295 | 1/13/2026 |