
What is the NET Command?
The NET
command in Windows is a powerful tool used to manage network resources, user accounts, services, and more from the command line. This command allows you to add or remove user accounts, manage groups, configure shared folders, and start or stop services. It is essential for system administrators and IT professionals looking to automate and streamline everyday network management tasks.
NET Command Syntax
NET
[ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START |
STATISTICS | STOP | TIME | USE | USER | VIEW ]
Each subcommand is used to execute specific management tasks. Below are key subcommands and their uses.
Key Subcommands and Their Uses
- NET USER
Manage user accounts (create, delete, change passwords, etc.).
- Example:
- View user accounts:
bash NET USER
- Create a new user:
bash NET USER newuser password /ADD
- Delete a user account:
bash NET USER username /DELETE
- View user accounts:
- NET LOCALGROUP
Manage local groups (add or remove users from groups).
- Example:
- View groups:
bash NET LOCALGROUP
- Add a user to a group:
bash NET LOCALGROUP groupname username /ADD
- Remove a user from a group:
bash NET LOCALGROUP groupname username /DELETE
- View groups:
- NET SHARE
Manage shared network folders (create, delete, view).
- Example:
- View shared folders:
bash NET SHARE
- Create a new shared folder:
bash NET SHARE sharename=C:\folderpath
- Delete a shared folder:
bash NET SHARE sharename /DELETE
- View shared folders:
- NET START / STOP
Start or stop Windows services.
- Example:
- View running services:
bash NET START
- Start a service:
bash NET START servicename
- Stop a service:
bash NET STOP servicename
- View running services:
- NET SESSION
Manage current sessions, view or disconnect remote sessions.
- Example:
- View current sessions:
bash NET SESSION
- Disconnect a session:
bash NET SESSION sessionname /DELETE
- View current sessions:
- NET COMPUTER
Manage computer accounts in a domain environment.
- Example:
- View domain computers:
bash NET COMPUTER
- Add a computer account:
bash NET COMPUTER computername /ADD
- View domain computers:
- NET CONFIG
Display network service configuration information.
- Example:
- View configuration:
bash NET CONFIG
- View configuration:
- NET HELP / HELPMSG
Display help information for NET commands.
- Example:
- View overall help:
bash NET HELP
- View help for a specific subcommand:
bash NET HELPMSG subcommand
- View overall help:
Detailed Subcommands Overview
- NET ACCOUNTS
Manage user account policies (password policies, account lockout policies).
- Example:
- Set minimum password length:
bash NET ACCOUNTS /MINPWLEN:8
- Set minimum password length:
- NET FILE
View shared file information and close open file handles.
- Example:
- View open files:
bash NET FILE
- View open files:
- NET GROUP
Manage domain groups (primarily used in domain environments).
- Example:
- View domain groups:
bash NET GROUP
- View domain groups:
- NET VIEW
View shared resources and computers on the network.
- Example:
- View shared resources:
bash NET VIEW
- View shared resources:
- NET USE
Map or disconnect network drives.
- Example:
- Map a network drive:
bash NET USE Z: \\servername\sharename
- Map a network drive:
Practical Use Cases for NET Command
1. Create a New User and Add Them to a Group
NET USER newuser password /ADD
NET LOCALGROUP "Administrators" newuser /ADD
This creates a new user account and adds the user to the “Administrators” group, granting them admin privileges.
2. Map and Disconnect a Network Drive
NET USE X: \\server\share /USER:username password
NET USE X: /DELETE
This command maps a network share to drive X and then disconnects the mapped drive when no longer needed.
3. Create and Delete a Shared Folder
NET SHARE sharename=C:\sharedfolder /GRANT:username,FULL
NET SHARE sharename /DELETE
This command shares a folder with full permissions and deletes the share when no longer needed.
Important Considerations When Using the NET Command
- Administrator privileges required: Most NET commands require administrator rights. Be sure to run the command prompt as an administrator.
- Accurate command input: Ensure correct syntax for user and group names to avoid errors.
- Understanding network environment: Some subcommands and options vary depending on whether you are working in a domain or workgroup environment.
Conclusion
The NET
command is a robust tool for efficiently managing network resources and user accounts in Windows. Whether you are managing user accounts, shared folders, or network services, this command simplifies and automates many common administrative tasks. By mastering the NET command, system administrators can significantly improve management efficiency in their Windows environments.

Thank you for reading to the end!
Comments