Click or drag to resize

UserAccountControl Class

Helper Functions for Privileges and Elevation Status
Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopUserAccountControl

Namespace: TomsToolbox.Desktop
Assembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public static class UserAccountControl

The UserAccountControl type exposes the following members.

Properties
 NameDescription
Public propertyStatic memberUacShieldIcon Gets a handle of the UAC (user account control) shield icon.
Top
Methods
 NameDescription
Public methodStatic memberGetProcessIntegrityLevel The function gets the integrity level of the current process. Integrity level is only available on Windows Vista and newer operating systems, thus GetProcessIntegrityLevel throws a C++ exception if it is called on systems prior to Windows Vista.
Public methodStatic memberIsCurrentUserInAdminGroup The function checks whether the primary access token of the process belongs to a user account that is a member of the local Administrators group, even if it currently is not elevated.
Public methodStatic memberIsCurrentUserInGroup Determines whether the current user is in the specified group.
Public methodStatic memberIsProcessElevated The function gets the elevation information of the current process. It dictates whether the process is elevated or not. Token elevation is only available on Windows Vista and newer operating systems, thus IsProcessElevated throws a C++ exception if it is called on systems prior to Windows Vista. It is not appropriate to use this function to determine whether a process is run as administrator.
Public methodStatic memberIsRunAsAdmin The function checks whether the current process is run as administrator. In other words, it dictates whether the primary access token of the process belongs to user account that is a member of the local Administrators group and it is elevated.
Public methodStatic memberIsUserInAdminGroup The function checks whether the object associated with the access token belongs to a user account that is a member of the local Administrators group, even if it currently is not elevated.
Public methodStatic memberIsUserInGroup Determines whether the current user is in the specified group.
Public Extension MethodLogOnInteractiveUser(NetworkCredential, SafeTokenHandle) Logs on the user with the given credentials as an interactive user.
Public methodStatic memberLogOnInteractiveUser(String, String, String, SafeTokenHandle) Logs on the user with the given credentials as an interactive user.
Public methodStatic memberPromptForCredential Prompts the user for credential.
Top
See Also