The WHOAMI command in Windows Command Prompt displays user, group, and privileges information for the user running the command. It is primarily used for troubleshooting and system administration to confirm user account details and memberships. This command can be particularly useful in environments with complex security settings or multiple user accounts.


The basic syntax of the WHOAMI command is:

WHOAMI [options]

Options can include:

  • /UPN : Displays the user name in User Principal Name (UPN) format.
  • /FQDN : Displays the fully qualified domain name (FQDN) for the user.
  • /USER : Displays user information.
  • /GROUPS : Displays the user groups.
  • /PRIV : Shows the security privileges of the current user.
  • /ALL : Displays all of the above information.
  • /FO format : Specifies the output format (TABLE, LIST, CSV).
  • /NH : Suppresses column headers in output. Useful in scripts or when piping output to other commands.


  • /UPN: Useful when you need to know the user’s principal name, often required in applications that use domain-based credentials.
  • /FQDN: Helpful in networks where domain details are necessary for troubleshooting or network setup.
  • /USER: Provides concise user account details, including the account name and SID.
  • /GROUPS: Lists all group memberships, which is crucial for checking access permissions and roles.
  • /PRIV: Lists out the security privileges. This is important for security auditing or verifying that a process can run with the necessary rights.
  • /ALL: Offers a comprehensive summary of the user, groups, and privileges. Ideal for detailed audits.
  • /FO format: Allows for formatting the output to fit different use cases or to make it easier for further processing by other tools.
  • /NH: Typically used in scripting to produce cleaner output that is easier to parse.


  1. Basic Usage:


    Displays the current domain and user name.

  2. View User Account Details:


    Displays detailed information about the user.

  3. List All Group Memberships:


    Lists all user groups the current user belongs to.

  4. Display Complete Information in Table Format:


    Provides a detailed table of user, group memberships, and privileges.

  5. Output Without Headers in CSV Format:


    Outputs group information in CSV format without column headers, ideal for scripting purposes.

Common Issues

  • Permission Errors: Some WHOAMI outputs, like /PRIV, might require administrative privileges. Ensure you have the necessary rights or run the command prompt as an administrator.
  • Output Clarity: Without proper formatting options, output can be overwhelming. Use /FO and /NH options to manage how information is displayed.


WHOAMI can be integrated with other CMD commands to build more complex scripts or solve specific problems:

  • Check Specific Group Membership and Act:
    FOR /F "tokens=*" %G IN ('WHOAMI /GROUPS /FO LIST /NH') DO (
      IF "%G" == "Administrators" (
        ECHO User is an Administrator.
  • Log User Details:
    WHOAMI /ALL > user_details.txt
  • NET USER: Provides information about user accounts and settings on the local machine or domain.
  • NET LOCALGROUP: Lists or modifies local groups on the computer.

Further information can be found in the official Microsoft documentation.