System.DirectoryServices.AccountManagement 9.0.0

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.
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 as well as .NET Standard.
13
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.
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. 6c6b536dffb4da0c45ff14921bfee10265265050 When using NuGet 3.x this package requires at least version 3.4.
11
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.
697

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

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