System.DirectoryServices.AccountManagement 9.0.0-preview.2.24128.5

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.
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 as well as .NET Standard.
9
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.
10
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.
12
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.
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.
9
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.
10
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.
12
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.
696

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

.NET 8.0

.NET 9.0

.NET Standard 2.0

Version Downloads Last updated
9.0.0-rc.2.24473.5 0 10/08/2024
9.0.0-rc.1.24431.7 0 09/10/2024
9.0.0-preview.7.24405.7 0 08/13/2024
9.0.0-preview.6.24327.7 0 07/09/2024
9.0.0-preview.5.24306.7 0 06/11/2024
9.0.0-preview.4.24266.19 6 06/01/2024
9.0.0-preview.3.24172.9 2 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.1 0 10/08/2024
8.0.0 8 05/08/2024
8.0.0-rc.2.23479.6 4 06/02/2024
8.0.0-rc.1.23419.4 2 06/02/2024
8.0.0-preview.7.23375.6 3 06/02/2024
8.0.0-preview.6.23329.7 5 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 2 06/02/2024
8.0.0-preview.1.23110.8 4 06/02/2024
7.0.1 4 06/02/2024
7.0.0 1 06/02/2024
7.0.0-rc.2.22472.3 5 06/02/2024
7.0.0-rc.1.22426.10 3 06/02/2024
7.0.0-preview.7.22375.6 5 06/02/2024
7.0.0-preview.6.22324.4 5 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 5 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 4 04/26/2024
6.0.0 3 06/02/2024
6.0.0-rc.2.21480.5 5 05/21/2024
6.0.0-rc.1.21451.13 4 04/26/2024
6.0.0-preview.7.21377.19 3 06/02/2024
6.0.0-preview.6.21352.12 2 06/02/2024
6.0.0-preview.5.21301.5 3 04/30/2024
6.0.0-preview.4.21253.7 4 05/22/2024
6.0.0-preview.3.21201.4 2 06/02/2024
6.0.0-preview.2.21154.6 2 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 5 05/19/2024
5.0.0-rc.1.20451.14 5 06/02/2024
5.0.0-preview.8.20407.11 0 08/25/2020
5.0.0-preview.7.20364.11 2 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 2 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 690 03/03/2023
4.7.0-preview3.19551.4 0 11/13/2019
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 6 04/25/2024
4.6.0-preview9.19416.11 2 06/02/2024
4.6.0-preview8.19405.3 4 06/02/2024
4.6.0-preview7.19362.9 5 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 5 05/03/2024
4.6.0-preview4.19212.13 5 06/02/2024
4.6.0-preview3.19128.7 3 06/02/2024
4.6.0-preview.19073.11 2 06/02/2024
4.6.0-preview.18571.3 4 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