Informational

1.5 Given a scenario, use the appropriate Microsoft command-line tools.

📘CompTIA A+ Core 2 (220-1202)


These are commands that help you gather information about the system, users, and Windows version. They are read-only commands, meaning they mostly show information rather than change settings. In IT environments, they are very useful for troubleshooting, auditing, and system documentation.


1. hostname

Purpose:
Shows the name of the computer on the network.

Syntax:

hostname

What it does:

  • Displays the PC’s name (computer name) assigned in Windows.
  • Helpful when you are connected to a network with multiple computers and need to identify which system you are working on.

Example in IT environment:

  • If you are remotely connected via RDP to multiple servers, typing hostname tells you which server you’re currently on.
  • Useful in scripts for logging which computer a report came from.

2. net user

Purpose:
Displays information about user accounts on a local computer or domain.

Syntax:

net user
  • To see details for a specific user:
net user [username]

What it does:

  • Without arguments, it lists all user accounts on the computer.
  • With a username, it shows account details like:
    • Full name
    • Account creation date
    • Last login
    • Group membership
    • Password settings (like expiration)

Example in IT environment:

  • You’re a help desk technician and a user can’t log in. Using net user [username] helps check if their account is active, if the password has expired, or if they belong to the correct group.

3. winver

Purpose:
Shows the Windows version and build number installed on the computer.

Syntax:

winver

What it does:

  • Opens a window that shows:
    • Windows edition (Home, Pro, Enterprise, etc.)
    • Version number (like Windows 11 version 22H2)
    • OS build number

Example in IT environment:

  • Useful when verifying compliance with company policies or software requirements.
  • For example, a certain application may only run on Windows 11 Pro 22H2 or later; winver confirms this.

4. whoami

Purpose:
Displays the current logged-in user and the user’s domain or computer name.

Syntax:

whoami

What it does:

  • Shows username in the format: DOMAIN\username or computername\username
  • Useful for confirming which account is being used in multi-user environments.

Example in IT environment:

  • When running a script remotely, whoami helps confirm you are executing commands with the correct permissions.
  • Prevents accidental changes from being made under the wrong account.

5. [command name] /?

Purpose:
Provides help information about any command, including options and syntax.

Syntax:

[command] /?

Example:

net user /?

What it does:

  • Displays detailed instructions for the command.
  • Lists all switches (optional parameters) you can use with the command.

Example in IT environment:

  • You are troubleshooting user account issues. Running net user /? shows all possible options like adding a new user, changing passwords, or enabling/disabling accounts.
  • It’s essential for learning commands and avoiding mistakes in scripts.

Summary Table

CommandPurposeExample IT Use
hostnameShow computer nameIdentify which server you are connected to
net userView user accounts and detailsCheck if a user’s account is active or password expired
winverShow Windows versionConfirm OS version for software compatibility
whoamiShow current logged-in userVerify permissions before running commands
[command] /?Show command helpLearn command options before using them

Exam Tips:

  1. All these commands are informational – they don’t change system settings.
  2. Practice using them in Command Prompt (cmd.exe) – the exam may ask which command to use for a given scenario.
  3. Remember /help and /? work interchangeably on many commands, but /help may not work for all older commands.

Buy Me a Coffee