AurorisNet.ActiveDirectory 1.2.1

dotnet add package AurorisNet.ActiveDirectory --version 1.2.1
                    
NuGet\Install-Package AurorisNet.ActiveDirectory -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AurorisNet.ActiveDirectory" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AurorisNet.ActiveDirectory" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="AurorisNet.ActiveDirectory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AurorisNet.ActiveDirectory --version 1.2.1
                    
#r "nuget: AurorisNet.ActiveDirectory, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AurorisNet.ActiveDirectory@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AurorisNet.ActiveDirectory&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=AurorisNet.ActiveDirectory&version=1.2.1
                    
Install as a Cake Tool

AurorisNet.ActiveDirectory

Wrappers over System.DirectoryServices for .NET 10 that read Active Directory users, groups, computers and printers.

The package adds ADUser, ADGroup, ADComputer, ADPrinter and the DirectorySearch helper, in the ActiveDirectory namespace. It runs on Windows, as an account that can read the directory.

Install

dotnet add package AurorisNet.ActiveDirectory

AurorisNet.IdentityServer and AurorisNet.IdentityServer.Directory install this package as a dependency.

Use

Read one user:

using System;
using ActiveDirectory;

using var user = new ADUser(@"EXAMPLE\alice");
Console.WriteLine(user.DisplayName);
Console.WriteLine(user.Email);

ADUser takes a SAM account name, a DOMAIN\user name or a full LDAP:// path, and throws InvalidOperationException when it finds no such user. Dispose each wrapper when you are done with it.

Search for users:

using ActiveDirectory;

var search = new DirectorySearch("LDAP://OU=Staff,DC=example,DC=com", ADObject.ObjectClass.User);
search.PropertiesToSearch.Add(ADProperties.User.Surname, "Smith", DirectorySearch.MatchType.StartsWith);
search.PropertiesToLoad.Add(ADProperties.User.DisplayName);
foreach (ADUser found in search.Find<ADUser>(25))
{
    using (found) Console.WriteLine(found.DisplayName);
}
  • A result holds only the attributes named in PropertiesToLoad. Any other attribute reads as empty until you call Bind() on the result, which opens a connection for it.
  • PropertiesToSearch values are escaped. AdditionalFilter is raw LDAP: build it from trusted values only.
  • Find<T>(howMany) limits the results. Set PageSize to read more results than the domain controller returns in one page.
  • AurorisNet.IdentityServer.Directory builds address-book searches, people pickers and group listings on this library.
  • AurorisNet.IdentityServer is an OpenID Connect server for Active Directory, Samba AD and FreeIPA.

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AurorisNet.ActiveDirectory:

Package Downloads
AurorisNet.IdentityServer

Embeddable OpenID Connect server for ASP.NET Core, backed by Active Directory, Samba AD or FreeIPA.

AurorisNet.IdentityServer.Directory

Active Directory people and group lookup for address books and people pickers: escaped, bounded searches, account lookups by SID, GUID or DOMAIN\user, and group listings, with application-supplied filters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 44 11/19/2026
1.2.0 101 11/18/2026
1.1.1 107 11/16/2026
1.1.0 85 11/16/2026
1.0.1 114 11/1/2026