Every action on a Windows computer happens under some user account, so managing accounts is the first job of a defender. In this lesson you will learn how to list, review and clean up users and groups on your own practice VM.
Safety note: do every exercise on your own practice virtual machine, and take a snapshot first so you can roll back.
Accounts and groups
A user account is an identity that can sign in. A group is a collection of accounts that share permissions. Instead of giving rights to each person, you give rights to a group and add people to it.
- Administrators can change almost anything on the machine, including installing software and editing security settings.
- Users are standard accounts that can run programs but cannot change system-wide settings.
- Guest is a built-in account for anonymous visitors. It should be disabled.
- Remote Desktop Users can sign in over the network with Remote Desktop.
The principle of least privilege says each person should have only the access they need to do their job. A homework account does not need to be an administrator.
Windows also has built-in accounts such as Administrator and DefaultAccount. You usually do not delete these, but you can disable the ones you do not use.
Managing accounts with the GUI
Press Win+R, type lusrmgr.msc and press Enter to open Local Users and Groups. This tool is not available on Windows Home editions, so use the commands below there.
- Open Users to see every local account. A down-arrow icon on an account means it is disabled.
- Open Groups, then double-click Administrators to see who has admin rights.
- Right-click a user and choose Properties to disable the account, or to uncheck “Password never expires” when your policy requires it.
- Compare the list against the authorized users list in your scenario README. Anyone not on it needs to be investigated.
Managing accounts from the command line
Open Command Prompt as administrator on your practice VM. These commands are read-only unless noted.
net user
net localgroup Administrators
net user alex
The first lists all local users, the second shows who is an administrator, and the third shows details for one account, including whether it is active and when the password was last set.
Changes you might make on your practice VM:
net user guest /active:no
net localgroup Administrators alex /delete
net user alex NewStr0ng!Passphrase
net user olduser /delete
Line one disables the Guest account. Line two removes alex from Administrators without deleting the account. Line three sets a new password (use your own long passphrase, never a real one). Line four deletes an account, which is permanent, so only do it for accounts the scenario says are unauthorized.
A simple audit routine
- Read the scenario README and write down every authorized user and which of them are administrators.
- Run
net userand compare. Note any extra accounts. - Run
net localgroup Administratorsand remove anyone who should be a standard user. - Disable Guest and any unused built-in accounts.
- Make sure every account has a strong password.
- Log what you changed, so you can explain it later.
Be careful: never delete the account you are signed in with, and never remove an authorized user just because their name looks odd.
Check your understanding
1. Which group lets a user change almost any setting on the computer?
- Users
- Guests
- Administrators
- Remote Desktop Users
Answer: Administrators. Members of this group have full control, so it should be kept as small as possible.
2. What does the principle of least privilege mean?
- Everyone shares one admin password
- Each account gets only the access it needs
- Disable all accounts at night
- Give new users administrator rights by default
Answer: Each account gets only the access it needs. This limits the damage if an account is misused or compromised.
3. Which command lists the members of the local Administrators group?
- net user guest
- net localgroup Administrators
- net view
- net stop
Answer: net localgroup Administrators. It prints every account that currently has admin rights.
4. You find an account that is not in the scenario’s authorized user list. What is the best first step?
- Ignore it
- Make it an administrator
- Check the README, then disable or remove it if it is truly unauthorized
- Reinstall Windows
Answer: Check the README, then disable or remove it if it is truly unauthorized. Always confirm against the authorized list before changing accounts.
