Net User and Net Group

Net User and Net Group

The net user and group commands are very powerful tools for managing local and domain users and groups.

In this post, I will show you how to use the net user command locally and on a domain to create a user account, reset a user account password, and view general info about a user account. I will also show you how to use the net group and net localgroup commands to manage local groups and domain groups, and how to view group members.

Net User

Create User Account

New Local User

For example, if I want to make a new local account named NewUser with a password of NewP@ssword1, the command will be net user NewUser NewP@ssword1 /add

New Domain User

For example, if I want to make a new domain user account named NewUser1 with a password of NewP@ssword1, the command will be net user NewUser1 NewP@ssword1 /add /domain

Change User Password

Change Local User Password

For example, if I want to change the password of the local account named NewUser to the password of NewP@ssword2, the command will be net user NewUser NewP@ssword2

Change Domain User Password

For example, if I want to change the password of a domain account named NewUser1 to the password of NewP@ssword2, the command will be net user NewUser1 NewP@ssword2 /domain

View User Details

View Local User Details

For example, if I want to view info about the local user account named NewUser, the command will be net user NewUser

View Domain User Details

For example, if I want to view info about the domain user account named test, the command will be net user test /domain

Net Group

Add User to a Group

Add User to Local Group

For example, if I want to add the account named NewUser to the local Administrators group, the command will be net localgroup Administrators NewUser /add

Another example is if I want to add the account named NewUser to the local Remote Desktop Users group, the command will be net localgroup "Remote Desktop Users" NewUser /add

Remove User from Local Group

For example, if I want to remove the account named NewUser from the local Administrators group, the command will be net localgroup Administrators NewUser /delete

Another example is if I want to remove the account named NewUser from the local Remote Desktop Users group, the command will be net localgroup "Remote Desktop Users" NewUser /delete

Add User to Domain Group

For example, if I want to add the domain user account named NewUser1 to the domain group named Domain Admins, I will run the following command net group "Domain Admins" NewUser1 /add /domain

Remove User from Domain Group

For example, if I want to remove the domain user account named NewUser1 from the domain group named Domain Admins, I will run the following command net group "Domain Admins" NewUser1 /delete /domain

View Group Details

View Local Group Members

For example, if I want to view the members of the local Administrators group, the command will be net localgroup Administrators

Another example is if I want to view the members of the local Remote Desktop Users group, the command will be net localgroup "Remote Desktop Users"

View Domain Group Members

For example, if I want to view the members of the domain group named Domain Admins, I will run the following command net group "Domain Admins" /domain

Another example is if I want to view the members of the domain group named Domain Controllers, I will run the following command net group "Domain Controllers" /domain

Summary

That covers how to manage users and groups using the net command. I find myself using the commands pretty often when troubleshooting or completing setups.

If you want to read more about the Net command, here is the Microsoft documentation.

Exit mobile version