This command-line tool returns the domain or computer name and the user name of the user who is currently logged onto the computer on which the tool is run.
WhoAmI displays the complete contents of the access token (for example, of the current user's security context) on standard output (STDOUT). 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.
WhoAmI Topics
File Required