Whoami.exe


This command-line tool returns the domain or computer name and the user name of the user currently logged onto the computer on which the tool runs.

Whoami displays the complete contents of the access token (for example, the current user's security context) in the command window. It displays the user name and security identifier (SID), the groups and their SIDs, the privileges and their status (for example, enabled or disabled), and the logon ID.

File Required

Whoami Topics


top

Whoami Syntax


WHOAMI [/all] [/noverbose] [/user] [/groups] [/priv] [/logonid] [/sid] [/help]

Where:

/all
displays all information in the current access token.
/noverbose
displays minimal information. Must be used with the /user, /groups, /priv, or /logonid option.
/user
displays current user.
/groups
displays groups.
/priv
displays privileges.
/logonid
displays logon ID.
/sid
displays security identifiers (SIDs). Must be used with the /user, /groups, /priv, or /logonid option.
/help
displays help.

top

Whoami Examples


Example 1: Get the Domain and User Name of the Current User

To learn the domain and user name of the person logged onto this computer, type:

whoami

Whoami returns the domain of the user followed by the user name. The command window information will look similar to the following data:

REDMOND\billybob

Example 2: Get Information About the Current Access Token

To display all the information in the current access token, type:

whoami /all

The following output is a sample of Whoami data:

[User] = "DCHRISROB\chrisrob" S-1-5-21-1099181476-344607857-928725530-1002
[Group 1] = "DCHRISROB\Domain Admins" S-1-5-21-1099181476-344607857-928725530-512
[Group 2] = "Everyone" S-1-1-0
[Group 3] = "DCHRISROB\RK Source" S-1-5-21-1099181476-344607857-928725530-1010
[Group 4] = "BUILTIN\Administrators" S-1-5-32-544
[Group 5] = "BUILTIN\Users" S-1-5-32-545
[Group 6] = "BUILTIN\Guests" S-1-5-32-546
[Group 7] = "DCHRISROB\Domain Users" S-1-5-21-1099181476-344607857-928725530-513
[Group 8] = "DCHRISROB\Domain Guests" S-1-5-21-1099181476-344607857-928725530-514
[Group 9] = "LOCAL" S-1-2-0
[Group 10] = "NT AUTHORITY\INTERACTIVE" S-1-5-4
[Group 11] = "NT AUTHORITY\Authenticated Users" S-1-5-11
[Login ID] = S-1-5-5-0-6552
(O) SeTcbPrivilege = Act as part of the operating system
(X) SeChangeNotifyPrivilege = Bypass traverse checking
(O) SeSecurityPrivilege = Manage auditing and security log
(O) SeBackupPrivilege = Back up files and directories
(O) SeRestorePrivilege = Restore files and directories
(O) SeSystemtimePrivilege = Change the system time
(O) SeShutdownPrivilege = Shut down the system
(O) SeRemoteShutdownPrivilege = Force shutdown from a remote system
(O) SeTakeOwnershipPrivilege = Take ownership of files or other objects
(O) SeDebugPrivilege = Debug programs
(O) SeSystemEnvironmentPrivilege = Modify firmware environment values
(O) SeSystemProfilePrivilege = Profile system performance
(O) SeProfileSingleProcessPrivilege = Profile single process
(O) SeIncreaseBasePriorityPrivilege = Increase scheduling priority
(O) SeLoadDriverPrivilege = Load and unload device drivers
(O) SeCreatePagefilePrivilege = Create a pagefile
(O) SeIncreaseQuotaPrivilege = Increase quotas