|

How To Use The Net Localgroup Command In Windows (2026)

Net localgroup is a Windows command for creating local groups and managing who belongs to them.

It lists groups, shows members, and adds or removes users from the command line.

This guide follows the syntax and examples Microsoft documents.

Table of Contents

Net localgroup quick answer

Run net localgroup in Command Prompt to list the local groups on the computer.

Add a group name to see its members, or add /add or /delete to change groups and membership.

GoalCommand
List all local groupsnet localgroup
Show the members of a groupnet localgroup exec
Create a groupnet localgroup exec /add
Add users to a groupnet localgroup exec stevev jennyt /add
Remove a user from a groupnet localgroup exec stevev /delete
Add a comment to a groupnet localgroup exec /comment:"The executive staff."
Delete a groupnet localgroup exec /delete

What the net localgroup command does

Microsoft says net localgroup adds, displays or modifies local groups.

Used without parameters, it displays the name of the server and the names of the local groups on the computer.

Use it to group users who use the computer or network in the same or similar ways.

When you assign rights to a local group, each member automatically has the same rights.

A note on the Microsoft page

The current Microsoft Learn page for this command was not available when this guide was written, so it follows Microsoft’s archived net localgroup page, last updated on 2016-08-31.

That page lists Windows Server 2008, Windows Server 2012 and Windows 8 as the systems it applies to.

Test any change on a PC you can afford to fix before you rely on it.

Why use groups

Groups save time because you assign rights to the group once.

Every member then automatically has the same rights.

Adding a person to the group gives them those rights, and removing them takes the rights away.

That is why Microsoft recommends grouping users who use the computer or network in similar ways.

Before you start

  1. Select Start and type Command Prompt.
  2. Open the Command Prompt result.
  3. Type the command you need and press Enter.

The example group name exec comes from Microsoft’s page, so replace it with your own group.

List local groups

Type the command with no parameters to display all local groups on the computer.

net localgroup

Show who is in a group

Used with just a group name, the command displays the users or global groups in that local group.

net localgroup exec

Create a local group

The /add parameter after a group name adds a local group to the local user accounts database.

net localgroup exec /add

Adding /domain performs the operation on the primary domain controller of the current domain instead.

Add users to a group

Put one or more user names after the group name and finish with /add.

Separate entries with a space.

Microsoft says you must first have an account for a user or global group before you can add it to a local group.

net localgroup exec stevev sales\ralphr jennyt /add

For a user from another domain, put the domain name first, as in Sales\Ralphr.

Names can be local users, users on other domains or global groups, but not other local groups.

Remove a user or delete a group

The /delete parameter removes a group name or user name from a local group, and used on a group name by itself it deletes the group.

GoalCommand
Remove a user from a groupnet localgroup exec stevev /delete
Delete the group itselfnet localgroup exec /delete

List the members first so you remove the right account.

Add a comment to a group

The /comment parameter adds a comment to a new or existing group.

The comment can contain up to 256 characters and goes in quotation marks.

net localgroup exec /comment:"The executive staff."

All net localgroup parameters

ParameterWhat it does
GroupNameThe local group to add, expand or delete
/comment:”Text”Adds a comment of up to 256 characters
/domainRuns on the primary domain controller of the current domain
Name […]One or more users or groups to add or remove
/addAdds a group, or adds names to a group
/deleteRemoves a name from a group, or deletes a group
net help CommandShows help for the named net command

Syntax forms

Microsoft documents three forms of the command.

FormUse
net localgroup [GroupName [/comment:"Text"]] [/domain]List groups, show members or comment
net localgroup GroupName {/add [/comment:"Text"] | /delete} [/domain]Add or delete a group
net localgroup GroupName Name [...] {/add | /delete} [/domain]Add or remove members

When to use /domain

Microsoft says /domain applies only to computers that are members of a domain.

By default, server computers perform operations on the primary domain controller.

Without it, the operation is performed on the local computer.

Microsoft’s examples

Microsoft lists these examples, all using a group called Exec.

TaskCommand
Display all local groups on the local servernet localgroup
Add the Exec group to the local user accounts databasenet localgroup exec /add
Add the Exec group to the domain user accounts databasenet localgroup exec /add /domain
Add stevev, ralphr (from the Sales domain) and jennyt to Exec on the local computernet localgroup exec stevev sales\ralphr jennyt /add
Add stevev, ralphr and jennyt to the Exec group of a domainnet localgroup exec stevev ralphr jennyt /add /domain
Display the users in Execnet localgroup exec
Add a comment to the Exec groupnet localgroup exec /comment:"The executive staff."

Common mistakes

  • Adding a name that has no account yet, because Microsoft says the account must exist first.
  • Trying to add one local group to another, because names can be users or global groups but not local groups.
  • Leaving out the domain name for a user from another domain, as in Sales\Ralphr.
  • Forgetting quotation marks around a comment.
  • Typing a comment longer than 256 characters.

If a command fails, run net help localgroup to see the built-in help for it.

Create the users you want to add with our Net User command guide.

To connect to a shared folder on another PC, see our Net Use command guide.

If a group policy change has not applied yet, our Gpupdate command guide shows how to refresh Group Policy.

Sources

Microsoft Learn (archived): Net localgroup.

Microsoft Learn: Windows commands.

Leave a Reply

Your email address will not be published. Required fields are marked *