Commands · Command

CommandWindows

whoami

whoami [/options]

Prints the username of the currently logged-in account running the command.

// FLAGS

/groupslist the security groups the current user belongs to
/privlist the current user's assigned privileges
/allshow user, groups, and privileges together

// EXAMPLE

whoami /groups — lists every security group the current session's user is a member of, useful for confirming domain group membership.

// GOTCHA

whoami reports the identity of the account the current process is running as — inside an elevated (Run as Administrator) prompt it can show a different-looking context than the desktop session, which confuses people expecting one consistent answer.

// RELATED COMMANDS