Microsoft Net Commands

Net localgroup

Adds, displays, or modifies local groups. Used without parameters, net localgroup displays the name of the server and the names of local groups on the computer.

Syntax

net localgroup [GroupName [/comment:"text"]] [/domain]

net localgroup [GroupName {/add [/comment:"text"] | /delete} [/domain]]

net localgroup [GroupName name [ ...] {/add | /delete} [/domain]]

Parameters

GroupName
Specifies the name of the local group to add, expand, or delete. Used without additional parameters, net localgroup GroupName displays a list of users or global groups in a local group.
/comment:"text"
Adds a comment for a new or existing group. The comment can contain up to 48 characters. Enclose the text in quotation marks.
/domain
Performs the operation on the primary domain controller of the current domain. Otherwise, the operation is performed on the local computer.
name [ ...]
Lists one or more user names or group names to add or remove from a local group.
/add
Adds a global group name or user name to a local group. You must first establish an account for users or global groups before you can add it to a local group with this command.
/delete
Removes a group name or user name from a local group.
net help command
Displays help for the specified net command.

Remarks

  • Using /domain

    /domain applies only to Windows XP Professional computers that are members of a domain. By default, server computers perform operations on the primary domain controller.

  • Using name

    Separate multiple entries with a space. Names can be local users, users on other domains, or global groups, but not other local groups. If a user is from another domain, preface the user name with the domain name (for example, Sales\Ralphr).

  • Grouping users

    Use net localgroup 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 of the local group automatically has the same rights.

Examples

To display a list of all the local groups on the local server, type:

net localgroup

To add a local group called Exec to the local user accounts database, type:

net localgroup exec /add

To add a local group called Exec to the domain user accounts database, type:

net localgroup exec /add /domain

To add the existing user accounts stevev, ralphr (from the Sales domain), and jennyt to the Exec local group on the local computer, type:

net localgroup exec stevev sales\ralphr jennyt /add

To add the existing user accounts stevev, ralphr, and jennyt to the Exec group of a domain, type:

net localgroup exec stevev ralphr jennyt /add /domain

To display users in the Exec local group, type:

net localgroup exec

To add a comment to the Exec local group record, type:

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

Formatting legend

Format Meaning
Italic Information that the user must supply
Bold Elements that the user must type exactly as shown
Ellipsis (...) Parameter that can be repeated several times in a command line
Between brackets ([]) Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd} Set of choices from which the user must choose only one
Courier font Code or program output

 

1