Vanara.Security 4.2.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Vanara.Security --version 4.2.0
                    
NuGet\Install-Package Vanara.Security -Version 4.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vanara.Security" Version="4.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vanara.Security" Version="4.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Vanara.Security" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Vanara.Security --version 4.2.0
                    
#r "nuget: Vanara.Security, 4.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Vanara.Security@4.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Vanara.Security&version=4.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Vanara.Security&version=4.2.0
                    
Install as a Cake Tool

Vanara

Vanara.Security NuGet Package

Version Build status

Classes for security related items derived from the Vanara PInvoke libraries. Includes extension methods for Active Directory and access control classes, methods for working with accounts, UAC, privileges, system access, impersonation and SIDs, and a full LSA wrapper.

What is Vanara?

Vanara is a community project that contains various .NET assemblies which have P/Invoke functions, interfaces, enums and structures from Windows libraries. Each assembly is associated with one or a few tightly related libraries.

Issues?

First check if it's already fixed by trying the MyGet build. If you're still running into problems, file an issue.

Included in Vanara.Security

Classes Enumerations
AccessControlHelper AccessExtension AccountPrivileges AccountUtils ActiveDirectoryExtension BadValueException CentralAccessPolicy CentralAccessPolicyEntry ClaimValue LogonRights PinnedAcl PinnedSecurityDescriptor PinnedSid PrivilegeAndAttributes PrivilegedCodeBlock PrivilegeExtension SystemAccountInfo SystemSecurity UAC WindowsLoggedInIdentity AccountLogonRights DesiredAccess SystemPrivilege
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Vanara.Security:

Package Downloads
Vanara.SystemServices

Classes for system related items derived from the Vanara PInvoke libraries. Includes extensions for Process (privileges and elavation), FileInfo (compression info), Shared Network Drives and Devices, and ServiceController (SetStartType) that pull extended information through native API calls.

Vanara.Windows.Forms

Classes for user interface related items derived from the Vanara PInvoke libraries. Includes extensions for almost all common controls to give post Vista capabilities, WinForms controls (panel, commandlink, enhanced combo boxes, IPAddress, split button, trackbar and themed controls), shutdown/restart/lock control, buffered painting, resource files, access control editor, simplifed designer framework for Windows.Forms.

Vanara.Library

The full set of packages associated with the Vanara PInvoke Libraries.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Vanara.Security:

Repository Stars
duplicati/duplicati
Store securely encrypted backups in the cloud!
lithnet/access-manager
Access Manager provides web-based access to local admin (LAPS) passwords, BitLocker recovery keys, and just-in-time administrative access to Windows computers in a modern, secure, and user-friendly way.
Version Downloads Last Updated
4.2.1 56 9/9/2025
4.2.0 310 8/25/2025
4.1.6 2,139 6/20/2025
4.1.5 166 6/20/2025
4.1.4 428 6/7/2025
4.1.3 605 4/24/2025
4.1.2 376 4/16/2025
4.1.1 543 3/7/2025
4.1.0 329 3/7/2025
4.0.6 308 2/24/2025
4.0.5 408 2/8/2025
4.0.4 2,124 9/13/2024
4.0.3 442 8/5/2024
4.0.2 670 6/24/2024
4.0.1 981 4/30/2024
4.0.0 376 3/29/2024
4.0.0-beta2 291 1/22/2024
4.0.0-beta 313 11/20/2023
3.4.17 2,411 10/18/2023
3.4.16 794 8/7/2023
3.4.15 688 5/18/2023
3.4.14 741 4/15/2023
3.4.13 1,695 2/4/2023
3.4.12 1,188 1/15/2023
3.4.11 1,283 11/15/2022
3.4.10 1,458 10/25/2022
3.4.9 1,348 10/3/2022
3.4.8 1,413 9/16/2022
3.4.7 1,472 9/3/2022
3.4.6 1,542 8/7/2022
3.4.5 6,306 7/17/2022
3.4.4 1,999 7/5/2022
3.4.3 1,585 6/14/2022
3.4.2 2,051 5/13/2022
3.4.1 1,528 5/5/2022
3.4.0 2,842 3/14/2022
3.3.15 5,138 12/27/2021
3.3.14 1,335 10/26/2021
3.3.13 1,139 9/30/2021
3.3.12 1,322 8/30/2021
3.3.11 9,618 7/22/2021
3.3.10 1,206 6/4/2021
3.3.9 1,466 5/7/2021
3.3.8 1,131 4/7/2021
3.3.7 1,108 3/24/2021
3.3.6 1,078 3/19/2021
3.3.5 1,144 3/1/2021
3.3.4 1,067 2/11/2021
3.3.3 1,075 2/3/2021
3.3.2 1,118 1/21/2021
3.3.1 1,195 1/20/2021
3.3.0 1,682 11/20/2020
3.2.21 1,199 11/13/2020
3.2.20 4,127 11/8/2020
3.2.19 7,962 10/23/2020
3.2.18 1,230 10/21/2020
3.2.17 2,771 9/20/2020
3.2.16 1,240 9/7/2020
3.2.15 1,262 8/30/2020
3.2.14 1,256 8/20/2020
3.2.13 1,281 7/27/2020
3.2.12 1,211 7/13/2020
3.2.11 1,310 6/28/2020
3.2.10 1,355 6/14/2020
3.2.9 1,319 6/3/2020
3.2.7 1,352 5/4/2020
3.2.6 1,297 4/21/2020
3.2.5 1,299 4/15/2020
3.2.4 1,268 4/12/2020
3.2.3 1,282 4/1/2020
3.2.2 1,237 3/24/2020
3.2.1 1,246 3/17/2020
3.2.0 1,542 2/27/2020
3.1.9 1,441 1/17/2020
3.1.8 1,333 1/13/2020
3.1.7 1,316 1/6/2020
3.1.6 1,327 12/12/2019
3.1.5 1,460 11/26/2019
3.1.4 1,333 11/25/2019
3.1.3 1,584 11/8/2019
3.1.2 1,327 11/4/2019
3.1.1 1,552 10/17/2019
3.1.0 1,301 10/3/2019
3.0.1 1,212 9/20/2019
3.0.0 1,154 8/27/2019
2.3.11 1,160 6/9/2019
2.3.10 1,053 6/5/2019
2.3.9 1,081 5/26/2019
2.3.8 1,033 5/13/2019
2.3.7 1,083 4/24/2019
2.3.6 1,074 4/17/2019
2.3.5 1,168 4/10/2019
2.3.4 1,092 3/9/2019
2.3.3 1,073 3/8/2019
2.3.2 1,077 2/28/2019
2.3.1 1,032 2/25/2019
2.3.0 1,059 2/22/2019
2.2.1 1,044 2/12/2019
2.2.0 1,096 2/1/2019
2.1.2 1,474 1/14/2019
2.1.0 1,404 12/15/2018
2.0.1 1,117 12/7/2018
2.0.0 1,197 11/28/2018
1.1.0 1,309 9/10/2018
1.0.18 1,315 8/10/2018
1.0.17 1,372 7/30/2018
1.0.16 1,592 6/29/2018
1.0.15 1,365 6/27/2018
1.0.14 1,447 6/8/2018
1.0.13 1,558 6/6/2018
1.0.12 1,652 4/5/2018
1.0.11 1,470 4/4/2018
1.0.10 1,650 3/27/2018
1.0.9 1,576 3/26/2018
1.0.8 1,653 2/7/2018
1.0.7 1,658 1/27/2018
1.0.6 1,641 1/8/2018
1.0.5 1,424 12/28/2017
1.0.4 1,742 12/15/2017
1.0.3 1,504 12/8/2017
1.0.2 1,477 11/30/2017
1.0.1 1,470 11/28/2017

Currently implements:

Classes
AccessControlHelper, AccessExtension, AccountPrivileges, AccountUtils, ActiveDirectoryExtension, BadValueException, CentralAccessPolicy, CentralAccessPolicyEntry, ClaimValue, LogonRights, PinnedAcl, PinnedSecurityDescriptor, PinnedSid, PrivilegeAndAttributes, PrivilegedCodeBlock, PrivilegeExtension, SystemAccountInfo, SystemSecurity, UAC, WindowsLoggedInIdentity

Enumerations
AccountLogonRights, DesiredAccess, SystemPrivilege