Skip to main content

How to Manage Windows Users with net user

·464 words·3 mins
Windows User Management
Table of Contents

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
#

  1. List all local users:
net user

This displays all local user accounts on the system.

  1. 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 is yes, 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
#

  1. Change a user’s password:
net user username newpassword
  1. Disable an account:
net user username /active:no
  1. Enable an account:
net user username /active:yes
  1. 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 PM
  • Sa-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 privileges
  • Users: Standard limited access
  1. Add a user to the Administrators group:
net localgroup administrators username /add
  1. Remove a user from the Administrators group:
net localgroup administrators username /del
  1. 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

Related

Windows 上常用的 20 CMD个命令及示例
·133 words·1 min
Windows CMD
AMD Gears Up to Launch Dual 3D V-Cache Ryzen 9000 CPUs
·564 words·3 mins
AMD 3D V-Cache Ryzen 9000
40 Years of FPGA: From Logic Arrays to AI at the Edge
·642 words·4 mins
Xilinx FPGA AI ZYNQ