Net localgroup windows 10

We use the command net localgroup to display and manage groups from the command prompt (CMD or PowerShell) in the Windows operating system.

Administrators can perform the following tasks using the net localgroup command:

  • Add new groups to the local computer or domain.
  • Remove existing groups from the local computer or domain.
  • Add users and groups to the Windows groups.
  • Remove users and groups from Windows groups.

Command options

GroupName Name of the group to be added or modified. If the group name includes spaces, enclose it in quotation marks.
/domain Use this command switch to execute the net localgroup command on the Active Directory domain controller rather than on the local computer.
/add Use this option to add new groups to the Windows system or add users to existing groups.
/delete Use this option to delete groups or remove members from groups.
/comment:»text» Adds a description to a Windows group.

Notes

When operating in an Active Directory domain environment, always use the /domain command switch.

There is another Windows command, the net group, which has the same syntax as the net localgroup. The net group command creates global groups; the net localgroup command creates local groups.

In the CMD, you can get help by running the net help localgroup command.

Next, we will learn more about the net localgroup command by looking at several examples.

Display Information on Existing Windows Groups

the net localgroup command

We can use the net localgroup command to list groups and view detailed information about a particular group.

To get a list of groups on the local computer, type net localgroup and press Enter:

net localgroup

To do the same thing on an Active Directory domain controller, use the /domain command switch:

net localgroup /domain

To get detailed information about a group, type net localgroup followed by the group name. For example, to view the Administrators group, you will run the following command:

net localgroup Administrators
net localgroup /domain Administrators

The command lists the users in the Administrators group.

net localgroup Administrators

Net Localgroup Administrators

Add/Delete Groups

To add a new local group, use the following syntax, where GroupName is the name of the new group:

net localgroup /add GroupName

For example, to create a group called sales, you will run the following command:

net localgroup /add sales

To remove a group from Windows, use the /delete option. For example, to remove an existing group called sales, you will run the following command:

net localgroup /delete sales

Add a description while creating the group:

net localgroup /add sales /comment:"This is Sales Group"

Add a description to the existing group:

net localgroup sales /comment:"Sales group"

Add (or Remove) User to the Groups

To add a user to a group, use the following syntax:

net localgroup /add GroupName UserName

The following command adds user user1 to the sales group:

net localgroup /add sales user1

You can add multiple users to a group at once:

net localgroup /add sales user1 user2

To remove a user from a group, use the /delete option:

net localgroup /delete sales user1
net localgroup /delete sales user1 user2

Examples

List all the local groups:

net localgroup

Add a new local group called sales:

net localgroup /add sales

Delete sales group:

net localgroup /delete sales

This command lists the users in the Remote Desktop Users group:

net localgroup "Remote Desktop Users"

The following command adds user user1 to the Remote Desktop Users group:

net localgroup /add "Remote Desktop Users" user1

The following command removes user1 from the Remote Desktop Users group:

net localgroup /delete "Remote Desktop Users" user1

What Next?

That brings the end to this tutorial. Next, you can learn the net user command, which is used to manage Windows users from the command prompt.

Download Windows Speedup Tool to fix errors and make PC run faster

Windows 11/10 offers a program — lusrmgr.msc or Local User and Group Management — which allows an administrator to manage local users and groups on the computer. However, the snap-in service is not available for Windows 11 Home or Windows 10 Home users. So if you want to access local user and group Management in Windows 11/10 Home, then you will have to try some alternatives. These alternatives may not be users friendly but they work.

Windows 11/10 Pro, Enterprise, etc. versions offer programs like lusrmgr.msc, Netplwiz, and even userpasswords2 programs that allow managing users and groups.

Windows 11/10Home users with admin privileges can use Command Line Interfaces such as NET LOCALGROUP and Microsoft.PowerShell.LocalAccounts to do the same thing.

local user management Windows 10 Home

How to use Net LocalGroup

Here is the complete syntax for this command which you can run over elevated Command Prompt

NET LOCALGROUP 
[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]

When you run only “Net Localgroup” it will list all the groups in the Windows 10 PC.

1] Add a user with and without domain

net localgroup <group_name> UserLoginName /add
net localgroup users domainname\<username> /add

2] Create a new group

net localgroup <groupname> /add

3] List all users in a group

net localgroup <groupname>

4] Remove a user from a group

net localgroup <groupname> <username> /delete

5] Delete a user from a group

net localgroup <groupname> /delete

PowerShell LocalAccounts Module

PowerShell Local Accounts Module

PowerShell offers a LocalAccount module which provides 15 cmdlets to manage Windows Users, and Groups. Here is the list:

  • Add-LocalGroupMember — Add a user to the local group
  • Disable-LocalUser —Disable a local user account
  • Enable-LocalUser — Enable a local user account
  • Get-LocalGroup — View local group preferences
  • Get-LocalGroupMember — View the list of all local group members
  • Get-LocalUser — View a local user account’s preferences
  • New-LocalGroup — Create a new local group
  • New-LocalUser — Create a new local user account
  • Remove-LocalGroup — Remove a local group
  • Remove-LocalGroupMember — Remove a member from a local group
  • Remove-LocalUser — Remove a local user account
  • Rename-LocalGroup — Rename a local group
  • Rename-LocalUser — Rename a local user account
  • Set-LocalGroup — Change the settings of a local group
  • Set-LocalUser — Change the account settings of a local user

So if you want to create a new local group, execute the following command

New-LocalGroup -Name "TWC"

To remove a member from a group, run this command:

Add-LocalGroupMember -Group 'TWC' –Member 'ashis'

Using both NET LOCALGROUP and Microsoft.PowerShell.LocalAccounts interface, you can manage users and groups easily. These commands are easy to use, but if you want a software-based approach, then try the Lusrmgr tool.

This post offers detailed steps on how to Add or Delete Local Users and Groups using PowerShell.

Ashish holds a Bachelor’s in Computer Engineering and is a veteran Windows. He has been a Microsoft MVP (2008-2010) and excels in writing tutorials to improve the day-to-day experience with your devices.

Windows provides command line utilities to manager user groups. In this post, learn how to use the command net localgroup to add user to a group from command prompt’

Add user to a group

Run the steps below –

  1. Open elevated command prompt
  2. Run the below command
    net localgroup group_name UserLoginName /add

    For example to add a user ‘John’ to administrators group, we can run the below command.

    net localgroup administrators John /add

Few more examples:

To add a domain user to local users group:

net localgroup users domainname\username /add

This command should be run when the computer is connected to the network. Otherwise you will get the below error.

H:\>net localgroup users domain\user /add
System error 1789 has occurred.
The trust relationship between this workstation and the primary domain failed.

To add a domain user to local administrator group:

net localgroup administrators domainname\username /add

To add a user to remote desktop users group:

net localgroup "Remote Desktop Users" UserLoginName  /add

To add a user to debugger  users group: 

net localgroup "Debugger users" UserLoginName /add

To add a user to Power users group: 

net localgroup "Power users" UserLoginName /add

This command works on all editions of Windows OS i.e Windows 2000, Windows XP, Windows Server 2003, Windows Vista and Windows 7. In Vista and Windows 7, even if you run the above command from administrator login you may still get access denied error like below.

C:\> net localgroup administrators techblogger /add
System error 5 has occurred.
Access is denied.

The solution for this is to run the command from elevated administrator account. See How to open elevated administrator command prompt

When you run the ‘net localgroup’ command from elevated command prompt:

C:\>net localgroup administrators techblogger /add
The command completed successfully.

To list the users belonging to a particular group we can run the below command.

net localgroup group_name

For example to list all the users belonging to administrators group we need to run the below command.

net localgroup administrators

Related posts:

Add new user account
Delete user account

Quick Links

  • Enable the Local Users and Groups Management Console in Windows 11/10 Home

  • Manage Local Users and Groups Using the Command Prompt

Summary

  • Local Users and Groups Management is not available in Windows 11/10 Home editions. You need a third-party program to access it.
  • You can use Lusrmgr.exe, a portable third-party alternative, to enable the Microsoft Management Console snap-in in Windows 11 Home. The Lusrmgr application provides additional features like account search and defining access times.
  • The Command Prompt can also be used to manage users and groups without a third-party utility.

Local Users and Groups Management is a shell application to manage local and remote computers and access system administrator tools. However, Local Users and Groups Management is unavailable in the Windows 11/10 Home editions, so you must rely on a third-party program to use it there.

Enable the Local Users and Groups Management Console in Windows 11/10 Home

Like the Local Group Policy Editor, Local Users and Groups Management (lusrmgr.msc) is an advanced feature available only on Windows Pro, Education, and Enterprise.

However, while you can use workarounds to enable Group Policy Editor on Windows Home, it is not possible to enable the Local Users and Groups Management snap-in console.

Instead, you can use Lusrmgr.exe, a third-party alternative, to enable the Microsoft Management Console snap-in in Windows 11 Home. Lusrmgr.exe is similar to the built-in Local Users and Groups Management console. It is a portable application, and you can download it from GitHub for free.

Here’s how to download and use the Local User and Group Management tool on Windows 11 Home. Follow the same steps on a Windows 10 PC:

  1. Open the lusrmgr GitHub page.
  2. On the default Code tab, scroll down to the Download link to get the latest version of the file.
  3. Once downloaded, double-click the lusrmgr.exe file to run the program.
lusrmgr program home screen running on Windows 11

You will notice the lusrmgr application looks similar to opening the native Local Users and Groups Management console. However, the difference lies in the usability of the tool. Below are side-by-side images for the built-in lusrmgr console (left) and the third-party application (right) for reference.

Lucal User and Groups app and lusrmgr app side by side comparison

To create a new user account with this Local User and Group Management tool:

  1. Right-click on User and select Create. Then fill in the details for the new user account.
  2. Click the Advanced button to configure the advanced account option, local path, and profile path.

    lusrmgr create new user account screen

  3. Click on Create to add the new user account.

Similarly, you can edit, remove, rename, or add a password to the existing user account. You can also enable the secret built-in administrator account using the tool.

Additional Features of the Lusrmgr App

The search bar in lusrmgr application

Apart from the usual account management features, lusrmgr.exe provides additional functions not available in the native utility. For example, you can use the search function to find a specific account. This is useful for system administrators who manage multiple user accounts in an organization.

Another handy feature is the ability to define access times for individual accounts. To set an access time, right-click on the username and select Edit. Next, open the Account tab and click on Define access time.

lusrmgr define account access time screen

By default, the user accounts have no limit on access time. But you can define this by selecting a time block for different days.

Since lusrmgr is a portable app, you can’t open it with the lusrmgr.msc command like the built-in app. To launch the program, double-click the executable file you downloaded and make the necessary changes to the user account or groups.

2. Manage Local Users and Groups Using the Command Prompt

You can use the «net localgroup» or «net user» command-line utility to manage users and groups on Windows 11/10. It’s a handy way to view, add, and delete local groups and users without using a third-party utility.

How to Run the Command Prompt as an Administrator in Windows Thumbnail

 

First, open a Command Prompt window with administrative privilege. To do this, press the Windows key, type cmd, right-click on Command Prompt, and select Run as administrator.

Below is a list of commands to view and manage local users and groups using the Command Prompt:

  1. To view the name of the server and local groups on the computer, type:

            net localgroup
        
  2. To view all users in a group, enter:

            net localgroup [groupname]
        
  3. To create a new group, use the following command. Replace xyz with the group name you want to create:

            net localgroup xyz /add
        
  4. To view all user accounts:

            net user
        
  5. To create a new user account (replace abc with the username you want to add):

            net user abc /add
        
  6. To view all the accounts with administrator privileges:

            net localgroup administrator
        
  7. To add a user account to the administrator group (be sure to change abc, and Administrator to the group name if needed):

            net localgroup Administrator abc /add
        
  8. To delete a local group:

            net localgroup xyz /delete
        
  9. To delete a local user:

            net user abc /delete
        
  10. If you need help with syntax for a specific command, use this:

            net help <command>
        
Command Prompt screen with the net localgroup command displayed

The Local Users and Groups Management console is a handy utility for system administrators to manage local computers and connect remotely to compatible systems. However, if you are running Windows 11 Home and need to use the lusrmgr.msc tool, your only option is to use the third-party application from GitHub.

In Windows 10, you can add or remove a user account from a group to grant or revoke access to certain Windows features, file system folders, shared objects, and more. There are a number of ways to do it. Let’s review them.

Group accounts are used to manage privileges for multiple users. Global group accounts, for domain use, are created in Active Directory Users And Computers, while local group accounts, for local system use, are created in Local Users And Groups. Generally, group accounts are created to facilitate the management of similar types of users. The types of groups that can be created include the following:

  • Groups for departments within the organization: Generally, users who work in the same department need access to similar resources. Because of this, groups can be created that are organized by department, such as Business Development, Sales, Marketing, or Engineering.
  • Groups for users of specific applications: Often, users will need access to an application and resources related to the application. Application-specific groups can be created so that users get proper access to the necessary resources and application files.
  • Groups for roles within the organization: Groups could also be organized by the user’s role within the organization. For example, executives probably need access to different resources than supervisors and general users. Thus, by creating groups based on roles within the organization, proper access is given to the users that need it.

A local user group is created locally. These are the groups you can use directly on a Windows 10 computer without adding the computer to an Active Directory domain. Here is the list of groups typically available in Windows 10 out-of-the box.

  • Administrators
  • Backup Operators
  • Cryptographic Operators
  • Distributed COM Users
  • Event Log Readers
  • Guests
  • IIS_IUSRS
  • Network Configuration Operators
  • Performance Log Users
  • Performance Monitor Users
  • Power Users
  • Remote Desktop Users
  • Replicator
  • Users

To add a user account to a local group in Windows 10, you can use either MMC, the console tool net.exe, or PowerShell. Let’s see how it can be done.

To add users to a group in Windows 10, do the following.

  1. Press Win + R shortcut keys on your keyboard and type the following in the run box:
    lusrmgr.msc

    Windows 10 Run Lusrmgr Msc

    This will open the Local Users and Groups app.

  2. Click on Groups on the left.
    Local Users And Groups

  3. Double-click the group you want to add users to in the list of groups.
    Remote Deskop Users Group

  4. Click the Add button to add one or more users.
  5. Alternatively, you can click the Users folder on the left.
  6. Double-click on the user account on the right.
    Windows 10 Add User To Group

  7. Switch to the Member of tab and click on the Add button to select a group you want to add the user account to.
    Windows 10 Member Of Tab

Note: You can use Local Users and Groups snap-in if your Windows edition comes with this app. Otherwise, you can use one of the methods described below.

Add users to a group using the NET tool

  1. Open an elevated command prompt.
  2. Type the following command:
    net localgroup "Group" "User" /add

    Replace the Group portion with the actual group name. Provide the desired user account instead of the «User» portion. For example, 

    Windows 10 Net Localgroup Add

  3. To remove a user from a group, execute the next command:
    net localgroup "Group" "User" /delete

    See the following screenshot:

    Windows 10 Net Localgroup Delete

Add users to a group using PowerShell

  1. Open PowerShell as Administrator. Tip: You can add «Open PowerShell As Administrator» context menu.
  2. Type or copy-paste the following command:
    Add-LocalGroupMember -Group "Group" -Member "User"

    Replace the Group portion with the actual group name. Provide the desired user account instead of the «User» portion.

    Windows 10 Add Localgroupmember

  3. To remove a user account from a group, use the cmdlet Remove-LocalGroupMember as follows.
    Remove-LocalGroupMember -Group "Group" -Member "User"

    Windows 10 Remove Localgroupmember

The Add-LocalGroupMember cmdlet adds users or groups to a local security group. All the rights and permissions that are assigned to a group are assigned to all members of that group.

The cmdlet Remove-LocalGroupMember removes members from a local group.

That’s it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won’t take a lot from you, but it will help us grow. Thanks for your support!

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как изменить цветопередачу на ноутбуке windows 11
  • Создание ftp сервера на windows server 2016
  • Где в диспетчере устройств оперативная память windows 10
  • Почему компьютер не видит вай фай windows 10
  • Пакетный менеджер для windows