Export (0) Print
Expand All
Arp
At
Cd
Cls
Cmd
Del
Dir
Fc
For
Ftp
If
Ldp
Lpq
Lpr
Md
Mmc
Msg
Nlb
Rcp
Rd
Reg
Rem
Ren
Rsh
Rsm
Rss
Sc
Set
Sfc
Ver
Vol
Expand Minimize

Whoami

Published: April 17, 2012

Updated: April 17, 2012

Applies To: Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista, Windows XP

Displays user, group and privileges information for the user who is currently logged on to the local system. If used without parameters, whoami displays the current domain and user name.

For examples of how to use this command, see Examples.

whoami [/upn | /fqdn | /logonid]
whoami {[/user] [/groups] [/priv]} [/fo <Format>] [/nh]
whoami /all [/fo <Format>] [/nh]

 

Parameter Description

/upn

Displays the user name in user principal name (UPN) format.

/fqdn

Displays the user name in fully qualified domain name (FQDN) format.

/logonid

Displays the logon ID of the current user.

/user

Displays the current domain and user name and the security identifier (SID).

/groups

Displays the user groups to which the current user belongs.

/priv

Displays the security privileges of the current user.

/fo <Format>

Specifies the output format. Valid values include:

table   Displays output in a table. This is the default value.

list   Displays output in a list.

csv   Displays output in comma-separated value (CSV) format.

/all

Displays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to.

/nh

Specifies that the column header should not be displayed in the output. This is valid only for table and CSV formats.

/?

Displays help at the command prompt.

To display the domain and user name of the person who is currently logged on to this computer, type:

whoami

Output similar to the following appears:

DOMAIN1\administrator

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

whoami /all

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft