How To Use The Whoami Command In Windows (2027)
Whoami is a built-in Windows command that tells you which account you are using.
It can also list that account’s groups, privileges and security identifier.
This guide covers each switch Microsoft documents.
Table of Contents
- Whoami quick answer
- What the whoami command does
- Open Command Prompt and run it
- Show your name and SID
- Show your groups
- Show your privileges
- Show everything in the access token
- Show your name in other formats
- Change the output format with /fo
- Which switch answers which question
- Combine switches in one command
- Save the output to a file
- How to read the basic output
- Windows versions
- All whoami parameters
- Syntax forms
- When whoami helps
- Sources
- More Windows guides
Whoami quick answer
Type whoami in Command Prompt and press Enter to see the domain and user name of the account you are signed in with.
Add switches to see the account’s groups, privileges or security identifier.
| Goal | Command |
|---|---|
| Current domain and user name | whoami |
| Name and security identifier (SID) | whoami /user |
| Groups the user belongs to | whoami /groups |
| Security privileges | whoami /priv |
| Everything in the access token | whoami /all |
| User principal name | whoami /upn |
| Logon ID | whoami /logonid |
What the whoami command does
Microsoft says whoami displays user, group and privilege information for the account currently signed in to the local system.
Run without parameters, it returns the current domain and user name.
Microsoft lists Windows 11 and Windows 10 among the systems it applies to.
Open Command Prompt and run it
- Select Start and type Command Prompt.
- Open the Command Prompt result.
- Type
whoamiand press Enter.
The output looks like DOMAIN1\administrator, which is the example Microsoft shows.
Show your name and SID
The /user switch displays the current domain and user name plus the security identifier (SID).
whoami /user
Show your groups
The /groups switch displays the user groups to which the current user belongs.
whoami /groupsThis helps you confirm whether your account is in a group such as the one you set up with a group command.
Show your privileges
The /priv switch displays the security privileges of the current user.
whoami /priv
Show everything in the access token
The /all switch displays all information in the current access token, including the user name, SIDs, privileges and groups.
whoami /allBecause the output is long, you can save it to a file, for example by adding > whoami.txt at the end of the command.
Show your name in other formats
| Switch | What it shows |
|---|---|
| /upn | The user name in user principal name (UPN) format |
| /fqdn | The user name in fully qualified domain name (FQDN) format |
| /logonid | The logon ID of the current user |
| /claims | The claims for the current user, such as claim name, flags, type and values |
Microsoft says /upn, /fqdn and /logonid belong to the first syntax form and do not combine with the other switches.
Change the output format with /fo
The /fo switch sets the output format for /user, /groups, /claims, /priv and /all.
| Value | Output |
|---|---|
| table | Column-formatted output with headers, and the default |
| list | Label and value pairs, one item per line |
| csv | Comma-separated values you can parse or import |
whoami /groups /fo csvAdd /nh to hide the column header, which works only with the table and csv formats.
Which switch answers which question
| Question | Switch |
|---|---|
| Which account am I using right now? | No switch |
| What is my SID? | /user |
| Which groups is my account in? | /groups |
| What privileges does my account have? | /priv |
| What is my UPN? | /upn |
| What is my FQDN-format name? | /fqdn |
| What is my logon ID? | /logonid |
| Show me all of it | /all |
Pick the narrowest switch that answers your question, because /all prints a long list.
Combine switches in one command
The second syntax form lets you combine /user, /groups, /claims and /priv with /fo and /nh.
The command below shows your name with its SID and your groups together.
whoami /user /groupsAdd /fo list if you prefer label and value pairs, one item per line.
whoami /user /groups /fo list
Save the output to a file
You can redirect the output of any whoami command into a text file using the greater-than sign, the same technique Microsoft shows for long gpresult output.
- Open Command Prompt.
- Type
whoami /all > whoami.txtand press Enter. - Open whoami.txt from the folder shown at the prompt.
The file is saved in the folder the Command Prompt window is currently in.
How to read the basic output
Microsoft’s example output for plain whoami is DOMAIN1\administrator.
The part before the backslash is the domain, and the part after it is the user name.
| Part | Example | Meaning |
|---|---|---|
| Before the backslash | DOMAIN1 | Domain |
| After the backslash | administrator | User name |
Windows versions
Microsoft’s current page says whoami applies to Windows 11, Windows 10 and several Windows Server versions.
Its older archived page, last updated in 2016, lists Windows versions back to Windows XP and does not mention the /claims switch.
So /claims is documented only on the current page, and you should expect the other switches on any recent Windows PC.
All whoami parameters
| Parameter | What it does |
|---|---|
| /upn | User name in UPN format |
| /fqdn | User name in FQDN format |
| /logonid | Logon ID of the current user |
| /user | Domain, user name and SID |
| /groups | Groups of the current user |
| /claims | Claims for the current user |
| /priv | Security privileges |
| /fo format | table, list or csv output |
| /all | All information in the access token |
| /nh | Suppresses the column header |
| /? | Help |
Syntax forms
| Form | Command |
|---|---|
| Name formats | whoami [/upn | /fqdn | /logonid] |
| Selected details | whoami {[/user] [/groups] [/claims] [/priv]} [/fo format] [/nh] |
| Everything | whoami /all [/fo format] [/nh] |
You can combine /user, /groups, /claims and /priv in one command, as the second form shows.
When whoami helps
- Checking which account a Command Prompt window is running as.
- Finding your SID for a command or support request.
- Checking which groups your account is in.
- Reviewing the privileges your account has.
If you need to change an account or its groups, see our Net User command guide and our Net Localgroup command guide.
To see which Group Policy settings apply to you, read our Gpresult command guide.
Our Tasklist and Taskkill guide covers another everyday command-line tool.
Sources
Microsoft Learn: whoami.
Microsoft Learn: Command-Line Syntax Key.
More Windows guides
- How To Use The Net Localgroup Command In Windows (2027)
- How To Use The Net User Command In Windows (2027)
- How To Use The Gpresult Command In Windows (2026)
- How To Use The Getmac Command In Windows (2026)
- How To Use The Arp Command In Windows (2026)
- How To Use The Driverquery Command In Windows (2026)
See all: Windows 11 Guides