| UserAccountControlIsUserInAdminGroup Method |
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.
Namespace: TomsToolbox.DesktopAssembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax public static bool IsUserInAdminGroup(
SafeTokenHandle userToken
)
Public Shared Function IsUserInAdminGroup (
userToken As SafeTokenHandle
) As Boolean
Parameters
- userToken SafeTokenHandle
- The user token.
Return Value
Boolean
Returns true if the object associated with the access token belongs to user
account that is a member of the local Administrators group. Returns false
if the token does not.
Exceptions Exception | Condition |
---|
Win32Exception | |
Win32Exception | When any native Windows API call fails, the function throws a Win32Exception with the last error code. |
See Also