Managing users, changing passwords, and setting login times are common tasks in daily Windows usage and system administration. While the graphical interface is user-friendly, it’s not always the most efficient. If you want to handle user management like a pro, the net user
command is your secret weapon.
This article offers a comprehensive guide to using net user
, equipping you with essential Windows user management skills from the command line.
What is net user
?
#
net user
is a built-in Windows command-line tool used to view, add, modify, and delete local user accounts. Whether you’re a home user, system admin, or a parent managing computer time, this command can come in handy.
Viewing User Information #
- List all local users:
net user
This displays all local user accounts on the system.
- View detailed info for a specific user:
net user username
Example:
net user kontronn
This will show you a range of information including account status, group memberships, password settings, login times, and more.
Creating a New User #
To create a new user:
net user username password /add
Example:
net user kontronn 123456 /add
This creates a new account named kontronn
with the password 123456
.
Tip: To prevent the user from being forced to change their password on first login, use
/passwordchg:no
. The default isyes
, which allows password changes.
Deleting a User #
net user username /del
Example:
net user testuser /del
This command removes a user account completely.
Modifying User Properties #
- Change a user’s password:
net user username newpassword
- Disable an account:
net user username /active:no
- Enable an account:
net user username /active:yes
- Force password change on next login:
net user username /logonpasswordchg:yes
Restricting User Login Times (Great for Parental Control) #
You can restrict when a user is allowed to log in:
net user username /times:time_range
Time range examples:
M-F,18:00-20:00
: Monday through Friday, 6 PM to 8 PMSa-Su,9:00-11:00
: Saturday and Sunday, 9 AM to 11 AM
12-hour time format (with am/pm
) is also supported. Separate multiple time ranges with semicolons (;
).
Example:
net user kontronn /times:M-F,18:00-20:00;Sa-Su,9:00-11:00;Sa-Su,15:00-17:00
To remove time restrictions:
net user kontronn /times:all
Managing User Group Membership (Access Control) #
In Windows, user permissions are defined by group membership. Common groups include:
Administrators
: Full privilegesUsers
: Standard limited access
- Add a user to the Administrators group:
net localgroup administrators username /add
- Remove a user from the Administrators group:
net localgroup administrators username /del
- Create a new group:
net localgroup groupname /add
Summary Table #
Task | Command Example |
---|---|
List all users | net user |
Create a user | net user username password /add |
Delete a user | net user username /del |
Change password | net user username newpassword |
Disable/Enable user | net user username /active:no or /active:yes |
Set login time | net user username /times:time_range |
Add to Admin group | net localgroup administrators username /add |