WhoAmI is a very powerful command utility in Windows 7 that easily reveals so much about you as the current user on your computer, including your login name, groups you belong to, privileges, etc. Released as a tool part of Windows XP resource kit, it has made its way becoming the official built-in tool since Vista.
Syntax
whoami [/upn | /fqdn | /logonid] whoami {[/user] [/groups] [/priv]} [/fo ] [/nh] whoami /all [/fo ] [/nh]
Now let’s take look some of the examples.
Use without any parameters
whoami displays the current domain and username or computer name and username if the user does not belong to the domain.
To find which group you belong to
whoami /groups
If the current user is a domain user, whoami also lists the domain groups the current user belong to.
What is my SID and LogonID?
To find out what your SSID is, use
whoami /user
To see what your LogonID is, use
whoami /logonid
To see my FDQN, if I am joined to the domain
whoami /fqdn
The command is only available when the current user is a domain-based user.
Ok, please give me all
whoami /all
The output format is ugly
You can use switch /fo with three formatting options to optimize the output, either table, which is by default, list, or CSV. If you are using CSV, you can export to a file that can be opened in your Excel.
To display the output in List format.
whoami /all /fo list
To export the output to a file in your Documents folder, use “>” at the end of the command.
whoami /all /fo CSV >%userprofile%\documents\myinfo.csv
You won’t see any output in the Dos command window, but instead, you will be able to open the saved file in Excel.
What if I am still running XP?
Fortunately, you can download it from this link and install it on your computer.