Windows NET Commands Every Sysadmin Should Know

Windows NET Commands Every Sysadmin Should Know

Windows NET Commands Every Sysadmin Should Know

Although PowerShell has become the preferred management tool for modern Windows administration, the old net commands remain incredibly useful. They’re installed on every Windows server and workstation, work over remote shells, and are often quicker than opening a GUI.

Tip: Open Command Prompt or PowerShell using Run as Administrator when performing account, group, share, or service changes. Many commands will fail with “Access Denied” if not elevated.

List Local Users

net user

Displays all local accounts on the system.

View details of a specific account:

net user username

Create a Local User

net user username Password123! /add

Creates a new local account.

Warning: Usernames and passwords entered directly into commands may be visible in command history or process monitoring tools.

Reset a Password

Set a password:

net user username NewPassword123!

Prompt securely for a password:

net user username *

This is generally the safer method as the password is not displayed on screen.

Disable or Enable an Account

Disable login access:

net user username /active:no

Re-enable login access:

net user username /active:yes
When to use: Staff departures, temporary security concerns, or troubleshooting account-related issues.

Force Password Change at Next Login

net user username /logonpasswordchg:yes

Remove the requirement:

net user username /logonpasswordchg:no

Prevent Password Changes

Prevent users changing their own password:

net user username /passwordchg:no

Allow changes again:

net user username /passwordchg:yes
Warning: This does not disable password expiry. It only prevents the user from changing their password manually.

Add a User to Local Administrators

net localgroup Administrators username /add

Remove administrator rights:

net localgroup Administrators username /delete

View current local administrators:

net localgroup Administrators
Security Warning: Membership of the local Administrators group grants full control of the machine, including software installation, local security changes, service management, and access to most system data.

Add Remote Desktop Access

net localgroup "Remote Desktop Users" username /add

Commonly used when granting RDP access to a workstation or server.

Check Password Policy

net accounts

Displays:

  • Minimum password length
  • Maximum password age
  • Password history
  • Lockout threshold
  • Lockout duration

Set password expiry to 90 days:

net accounts /maxpwage:90

Disable expiry for all local accounts:

net accounts /maxpwage:unlimited
Warning: These settings affect all local user accounts on the machine, not just a single user.

Password Never Expires (Single User)

This cannot be configured using net user.

Use PowerShell instead:

Set-LocalUser -Name "username" -PasswordNeverExpires $true

View Existing Shares

net share

Create a share:

net share Data=C:\Data

Delete a share:

net share Data /delete
Destructive Action: Removing a share immediately disconnects users and applications relying on that shared path.

Start and Stop Services

Start a service:

net start spooler

Stop a service:

net stop spooler
Warning: Stopping production services may disconnect users or interrupt business-critical workloads. Verify dependencies before proceeding.

Check Administrative Rights

net session

If the command returns:

Access is denied.

the command prompt is not running with administrative privileges.

My Most Used NET Commands

net user
net user username
net user username *
net localgroup Administrators
net accounts
net share
net start
net stop

Despite their age, these commands remain some of the fastest ways to manage Windows systems, particularly when working through Command Prompt, Server Core installations, Hyper-V hosts, recovery environments, or remote support sessions.

Loading

Back to top