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.
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 as well as .NET Standard.
58
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.
65
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.
77
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.
87
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.
90
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.
64
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.
78
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.
66
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.
78
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
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.
65
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.
69
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.
71
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.
72
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.
76
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.
81
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.
83
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.
89

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

Version Downloads Last updated
9.0.0 9 11/13/2024
9.0.0-rc.2.24473.5 8 10/14/2024
9.0.0-rc.1.24431.7 8 09/15/2024
9.0.0-preview.7.24405.7 13 08/14/2024
9.0.0-preview.6.24327.7 8 07/10/2024
9.0.0-preview.5.24306.7 11 06/14/2024
9.0.0-preview.4.24266.19 10 05/24/2024
9.0.0-preview.3.24172.9 13 04/21/2024
9.0.0-preview.2.24128.5 11 03/14/2024
9.0.0-preview.1.24080.9 16 02/26/2024
8.0.1 9 10/09/2024
8.0.0 15 11/17/2023
8.0.0-rc.2.23479.6 17 10/22/2023
8.0.0-rc.1.23419.4 30 09/20/2023
8.0.0-preview.7.23375.6 43 09/11/2023
8.0.0-preview.6.23329.7 25 09/10/2023
8.0.0-preview.5.23280.8 36 06/14/2023
8.0.0-preview.4.23259.5 26 05/17/2023
8.0.0-preview.3.23174.8 40 04/14/2023
8.0.0-preview.2.23128.3 52 04/05/2023
8.0.0-preview.1.23110.8 53 03/08/2023
7.0.1 17 09/20/2023
7.0.0 52 12/18/2022
7.0.0-rc.2.22472.3 55 10/15/2022
7.0.0-rc.1.22426.10 98 09/23/2022
7.0.0-preview.7.22375.6 44 09/12/2022
7.0.0-preview.6.22324.4 40 09/22/2022
7.0.0-preview.5.22301.12 103 09/23/2022
7.0.0-preview.4.22229.4 35 09/22/2022
7.0.0-preview.3.22175.4 100 09/25/2022
7.0.0-preview.2.22152.2 34 09/22/2022
7.0.0-preview.1.22076.8 37 09/24/2022
6.0.2-mauipre.1.22102.15 102 09/26/2022
6.0.2-mauipre.1.22054.8 93 09/23/2022
6.0.1 7 11/14/2024
6.0.0 50 09/26/2022
6.0.0-rc.2.21480.5 78 09/22/2022
6.0.0-rc.1.21451.13 87 09/22/2022
6.0.0-preview.7.21377.19 82 09/22/2022
6.0.0-preview.6.21352.12 70 09/23/2022
6.0.0-preview.5.21301.5 54 09/24/2022
6.0.0-preview.4.21253.7 47 09/24/2022
6.0.0-preview.3.21201.4 90 09/21/2022
6.0.0-preview.2.21154.6 72 09/25/2022
6.0.0-preview.1.21102.12 64 09/23/2022
5.0.0 39 09/23/2022
5.0.0-rc.2.20475.5 65 09/22/2022
5.0.0-rc.1.20451.14 61 09/23/2022
5.0.0-preview.8.20407.11 44 09/26/2022
5.0.0-preview.7.20364.11 64 09/22/2022
5.0.0-preview.6.20305.6 83 09/22/2022
5.0.0-preview.5.20278.1 68 09/22/2022
5.0.0-preview.4.20251.6 36 09/23/2022
5.0.0-preview.3.20214.6 83 09/25/2022
5.0.0-preview.2.20160.6 60 09/22/2022
5.0.0-preview.1.20120.5 42 09/23/2022
4.7.0 24 09/22/2022
4.7.0-preview3.19551.4 90 09/22/2022
4.7.0-preview2.19523.17 66 09/22/2022
4.7.0-preview1.19504.10 31 09/22/2022
4.6.0 38 09/25/2022
4.6.0-rc1.19456.4 97 09/24/2022
4.6.0-preview9.19421.4 54 09/24/2022
4.6.0-preview9.19416.11 59 09/22/2022
4.6.0-preview8.19405.3 45 09/23/2022
4.6.0-preview7.19362.9 88 09/22/2022
4.6.0-preview6.19303.8 70 09/25/2022
4.6.0-preview6.19264.9 54 09/22/2022
4.6.0-preview5.19224.8 50 09/26/2022
4.6.0-preview4.19212.13 56 09/22/2022
4.6.0-preview3.19128.7 37 09/23/2022
4.6.0-preview.19073.11 63 09/24/2022
4.6.0-preview.18571.3 45 09/23/2022
4.5.0 34 09/22/2022
4.5.0-rc1 30 09/21/2022
4.5.0-preview2-26406-04 98 09/22/2022
4.5.0-preview1-26216-02 47 09/22/2022
4.5.0-preview1-25914-04 56 09/22/2022