System.DirectoryServices.AccountManagement 9.0.0-preview.4.24266.19

About

Provides uniform access and manipulation of security principals across multiple principal stores. The principal objects in the Account Management API include computer, group and user objects. The principal stores includes:

  • Active Directory Domain Services (AD DS)
  • Active Directory Lightweight Directory Services (AD LDS)
  • Machine SAM (MSAM).

Key Features

  • Basic directory operations such as creating and updating security principals. The application requires less knowledge of the underlying stores to perform these operations.
  • Applications can extend the object model to include new types of directory objects.
  • Account management tasks, such as enabling and disabling a user account.
  • Cross-store support allows group objects in the Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM) databases to contain members from different types of stores.
  • Query by example searching, available on the PrincipalSearcher class, enables applications to set properties on a principal object and search the selected store for other objects that contain matching property values.
  • Enhanced search on computer, user and group principal objects enables applications to search the selected store for matching principal objects.
  • Recursive search, available on the group principal object, enables applications to search a group recursively and return only principal objects that are leaf nodes.
  • Credential validation against the Machine SAM, AD DS, and AD LS stores.
  • Connections speeds are increased by using the Fast Concurrent Bind (FSB) feature when available. Connection caching decreases the number of ports used.

How to Use

// Create the principal context for the usr object.
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "securelyStoredPassword");

// Create the principal user object from the context.
UserPrincipal usr = new UserPrincipal(ctx);
usr.AdvancedSearchFilter.LastLogonTime(DateTime.Now, MatchType.LessThan); 
usr.AdvancedSearchFilter.LastLogonTime(DateTime.Yesterday, MatchType.GreaterThan);

// Create a PrincipalSearcher object.
PrincipalSearcher ps = new PrincipalSearcher(usr);
PrincipalSearchResult<Principal> fr = ps.FindAll();
foreach (UserPrincipal u in results)
{
    Console.WriteLine(u.Name);
}

Main Types

The main types provided by this library are:

  • System.DirectoryServices.AccountManagement.PrincipalContext
  • System.DirectoryServices.AccountManagement.PrincipalSearcher
  • System.DirectoryServices.AccountManagement.Principal and its subclasses: System.DirectoryServices.AccountManagement.UserPrincipal, System.DirectoryServices.AccountManagement.GroupPrincipal and System.DirectoryServices.AccountManagement.ComputerPrincipal

Additional Documentation

System.DirectoryServices

Feedback & Contributing

System.DirectoryServices.AccountManagement is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.DirectoryServices.AccountManagement.

Packages Downloads
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.
4
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.
5
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.
8
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 Core as well as .NET Standard.
5
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 Core as well as .NET Standard.
6
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 Core as well as .NET Standard. 00490982c7952e96a1089818467caa6fd07541b2 When using NuGet 3.x this package requires at least version 3.4.
5
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 Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
4
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 Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
5
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 Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
8
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 Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
689

https://go.microsoft.com/fwlink/?LinkID=799421

.NET 8.0

.NET 9.0

.NET Standard 2.0

Version Downloads Last updated
9.0.0-preview.4.24266.19 2 06/01/2024
9.0.0-preview.3.24172.9 1 06/02/2024
9.0.0-preview.2.24128.5 3 04/26/2024
9.0.0-preview.1.24080.9 1 06/02/2024
8.0.0 7 05/08/2024
8.0.0-rc.2.23479.6 2 06/02/2024
8.0.0-rc.1.23419.4 1 06/02/2024
8.0.0-preview.7.23375.6 3 06/02/2024
8.0.0-preview.6.23329.7 4 06/02/2024
8.0.0-preview.5.23280.8 1 06/02/2024
8.0.0-preview.4.23259.5 3 06/02/2024
8.0.0-preview.3.23174.8 4 06/02/2024
8.0.0-preview.2.23128.3 1 06/02/2024
8.0.0-preview.1.23110.8 2 06/02/2024
7.0.1 3 06/02/2024
7.0.0 1 06/02/2024
7.0.0-rc.2.22472.3 4 06/02/2024
7.0.0-rc.1.22426.10 2 06/02/2024
7.0.0-preview.7.22375.6 4 06/02/2024
7.0.0-preview.6.22324.4 4 04/26/2024
7.0.0-preview.5.22301.12 3 06/02/2024
7.0.0-preview.4.22229.4 1 06/02/2024
7.0.0-preview.3.22175.4 1 06/02/2024
7.0.0-preview.2.22152.2 3 06/02/2024
7.0.0-preview.1.22076.8 3 06/02/2024
6.0.2-mauipre.1.22102.15 3 06/02/2024
6.0.2-mauipre.1.22054.8 3 04/26/2024
6.0.0 2 06/02/2024
6.0.0-rc.2.21480.5 5 05/21/2024
6.0.0-rc.1.21451.13 3 04/26/2024
6.0.0-preview.7.21377.19 3 06/02/2024
6.0.0-preview.6.21352.12 1 06/02/2024
6.0.0-preview.5.21301.5 2 04/30/2024
6.0.0-preview.4.21253.7 4 05/22/2024
6.0.0-preview.3.21201.4 1 06/02/2024
6.0.0-preview.2.21154.6 1 06/02/2024
6.0.0-preview.1.21102.12 1 06/02/2024
5.0.0 6 11/02/2022
5.0.0-rc.2.20475.5 3 05/19/2024
5.0.0-rc.1.20451.14 4 06/02/2024
5.0.0-preview.7.20364.11 1 06/02/2024
5.0.0-preview.6.20305.6 1 06/02/2024
5.0.0-preview.5.20278.1 2 06/02/2024
5.0.0-preview.4.20251.6 2 06/02/2024
5.0.0-preview.3.20214.6 1 06/02/2024
5.0.0-preview.2.20160.6 2 06/02/2024
5.0.0-preview.1.20120.5 1 06/02/2024
4.7.0 688 03/03/2023
4.7.0-preview2.19523.17 1 06/02/2024
4.7.0-preview1.19504.10 3 05/08/2024
4.6.0 5 06/02/2024
4.6.0-rc1.19456.4 2 06/02/2024
4.6.0-preview9.19421.4 4 04/25/2024
4.6.0-preview9.19416.11 2 06/02/2024
4.6.0-preview8.19405.3 3 06/02/2024
4.6.0-preview7.19362.9 4 04/26/2024
4.6.0-preview6.19303.8 1 06/02/2024
4.6.0-preview6.19264.9 1 06/02/2024
4.6.0-preview5.19224.8 4 05/03/2024
4.6.0-preview4.19212.13 4 06/02/2024
4.6.0-preview3.19128.7 2 06/02/2024
4.6.0-preview.19073.11 1 06/02/2024
4.6.0-preview.18571.3 3 06/02/2024
4.5.0 1 06/02/2024
4.5.0-rc1 4 05/17/2024
4.5.0-preview2-26406-04 2 06/02/2024
4.5.0-preview1-26216-02 3 06/02/2024
4.5.0-preview1-25914-04 1 06/02/2024