System.DirectoryServices.AccountManagement 9.0.0-preview.3.24172.9

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.
35
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.
43
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.
44
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.
52
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.
55
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.
32
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.
45
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.
48
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. 10dc31ea70c14a33f371cea5a757a3d95b218acf When using NuGet 3.x this package requires at least version 3.4.
39
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. 8f968b9e79c5721d78cc88e46fe57457fe9d490d When using NuGet 3.x this package requires at least version 3.4.
51
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.
39
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.
40
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.
41
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.
43
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.
44
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.
45
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.
48
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.
55
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.
56

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.3.24172.9 1 04/21/2024
9.0.0-preview.2.24128.5 2 03/14/2024
9.0.0-preview.1.24080.9 3 02/26/2024
8.0.0 4 11/17/2023
8.0.0-rc.2.23479.6 4 10/22/2023
8.0.0-rc.1.23419.4 11 09/20/2023
8.0.0-preview.7.23375.6 26 09/11/2023
8.0.0-preview.6.23329.7 8 09/10/2023
8.0.0-preview.5.23280.8 18 06/14/2023
8.0.0-preview.4.23259.5 13 05/17/2023
8.0.0-preview.3.23174.8 27 04/14/2023
8.0.0-preview.2.23128.3 34 04/05/2023
8.0.0-preview.1.23110.8 35 03/08/2023
7.0.1 8 09/20/2023
7.0.0 37 12/18/2022
7.0.0-rc.2.22472.3 43 10/15/2022
7.0.0-rc.1.22426.10 63 09/23/2022
7.0.0-preview.7.22375.6 30 09/12/2022
7.0.0-preview.6.22324.4 25 09/22/2022
7.0.0-preview.5.22301.12 64 09/23/2022
7.0.0-preview.4.22229.4 21 09/22/2022
7.0.0-preview.3.22175.4 64 09/25/2022
7.0.0-preview.2.22152.2 20 09/22/2022
7.0.0-preview.1.22076.8 22 09/24/2022
6.0.2-mauipre.1.22102.15 61 09/26/2022
6.0.2-mauipre.1.22054.8 61 09/23/2022
6.0.0 36 09/26/2022
6.0.0-rc.2.21480.5 61 09/22/2022
6.0.0-rc.1.21451.13 55 09/22/2022
6.0.0-preview.7.21377.19 51 09/22/2022
6.0.0-preview.6.21352.12 44 09/23/2022
6.0.0-preview.5.21301.5 35 09/24/2022
6.0.0-preview.4.21253.7 29 09/24/2022
6.0.0-preview.3.21201.4 57 09/21/2022
6.0.0-preview.2.21154.6 47 09/25/2022
6.0.0-preview.1.21102.12 40 09/23/2022
5.0.0 26 09/23/2022
5.0.0-rc.2.20475.5 45 09/22/2022
5.0.0-rc.1.20451.14 41 09/23/2022
5.0.0-preview.8.20407.11 27 09/26/2022
5.0.0-preview.7.20364.11 46 09/22/2022
5.0.0-preview.6.20305.6 55 09/22/2022
5.0.0-preview.5.20278.1 48 09/22/2022
5.0.0-preview.4.20251.6 20 09/23/2022
5.0.0-preview.3.20214.6 53 09/25/2022
5.0.0-preview.2.20160.6 41 09/22/2022
5.0.0-preview.1.20120.5 34 09/23/2022
4.7.0 16 09/22/2022
4.7.0-preview3.19551.4 61 09/22/2022
4.7.0-preview2.19523.17 49 09/22/2022
4.7.0-preview1.19504.10 15 09/22/2022
4.6.0 25 09/25/2022
4.6.0-rc1.19456.4 64 09/24/2022
4.6.0-preview9.19421.4 36 09/24/2022
4.6.0-preview9.19416.11 43 09/22/2022
4.6.0-preview8.19405.3 29 09/23/2022
4.6.0-preview7.19362.9 56 09/22/2022
4.6.0-preview6.19303.8 50 09/25/2022
4.6.0-preview6.19264.9 36 09/22/2022
4.6.0-preview5.19224.8 31 09/26/2022
4.6.0-preview4.19212.13 31 09/22/2022
4.6.0-preview3.19128.7 21 09/23/2022
4.6.0-preview.19073.11 46 09/24/2022
4.6.0-preview.18571.3 25 09/23/2022
4.5.0 19 09/22/2022
4.5.0-rc1 18 09/21/2022
4.5.0-preview2-26406-04 66 09/22/2022
4.5.0-preview1-26216-02 33 09/22/2022
4.5.0-preview1-25914-04 41 09/22/2022