Overview
This lecture covers how to add and remove local user accounts on a Windows machine using both GUI tools and command-line interfaces (CLI).
Creating Local User Accounts (GUI)
- Open Computer Management and navigate to Local Users and Groups.
- Right-click "Users" and select "New User" to add an account.
- Fill in username, full name, and password fields.
- Set a default password and check "User must change password at next logon."
- Click "Create" to finish adding the user.
Removing Local User Accounts (GUI)
- Right-click the user in Local Users and Groups and select "Delete."
- Confirm the warning that old resources are inaccessible even with the same username.
- Complete the deletion to remove the user account.
Creating and Managing Users (CLI)
- Use the
net user <username> * /add command to add a user and prompt for a password.
- Use
net user <username> /logonpasswordchg:yes to require a password change at next logon.
- Combine both commands to create an account that forces a password update on first login.
- Use
Get-LocalUser to list local users and verify account creation.
- PowerShell's
New-LocalUser command can also create users but requires scripting.*
Removing Users (CLI)
- Delete an account using
net user <username> /delete.
- Alternatively, use the PowerShell command
Remove-LocalUser -Name <username>.
Recognizing Command Patterns
- Many CLI commands follow identifiable patterns (e.g., add vs delete).
- Understanding these patterns helps you learn new commands and recall them when needed.
Key Terms & Definitions
- Local User Account — A user profile stored and managed on the local computer only.
- net user — A command-line tool for managing user accounts on Windows.
- /add, /delete, /logonpasswordchg — Parameters for adding, deleting, and managing password policies for accounts.
- Get-LocalUser, New-LocalUser, Remove-LocalUser — PowerShell commands to list, create, and delete local users.
Action Items / Next Steps
- Practice adding and removing users using both the GUI and CLI.
- Refer to supplemental reading for advanced usage of
New-LocalUser.