How To Detect Elevation From The Commandline

RSS
Modified on 2012/03/11 13:53 by Mark Categorized as uac, windows
With the introduction of UAC in Windows Vista - and it's improvements in Windows 7 and Server 2008 R2 - using the commandline (CMD.EXE) has gained an additional hurdle to performing administrative operations. This page describes how to detect if you are executing with administrative privileges.

Who Am I?

You can use the following command from the windows commandline to determine if the process is running with an elevated privileges token:
whoami /groups

If the output contains these lines the process is running elevated:
Mandatory Label\High Mandatory Level Label            S-1-16-12288
                    Mandatory group, Enabled by default, Enabled group



See also: