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
hostnametells 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;
winverconfirms 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\usernameorcomputername\username - Useful for confirming which account is being used in multi-user environments.
Example in IT environment:
- When running a script remotely,
whoamihelps 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
| Command | Purpose | Example IT Use |
|---|---|---|
hostname | Show computer name | Identify which server you are connected to |
net user | View user accounts and details | Check if a user’s account is active or password expired |
winver | Show Windows version | Confirm OS version for software compatibility |
whoami | Show current logged-in user | Verify permissions before running commands |
[command] /? | Show command help | Learn command options before using them |
✅ Exam Tips:
- All these commands are informational – they don’t change system settings.
- Practice using them in Command Prompt (cmd.exe) – the exam may ask which command to use for a given scenario.
- Remember
/helpand/?work interchangeably on many commands, but/helpmay not work for all older commands.
