Condividi tramite


Net group

 

Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2003 R2, Windows Server 2000, Windows Server 2012, Windows Server 2003 with SP1, Windows 8

Adds, displays, or modifies global groups in domains.

Net group is a command-line tool that is built into Windows Vista. To run net group, open a command prompt, type net group with the appropriate parameters, and then press ENTER.

For examples of how this command can be used, see Examples.

Syntax

net group [<GroupName> [/comment:"<Text>"]] [/domain]
net group [<GroupName>{/add [/comment:"<Text>"] | /delete} [/domain]]
net group [<GroupName> <UserName>[ ...] {/add | /delete} [/domain]]

Parameters

Parameter

Description

<GroupName>

Specifies the name of the group to add, expand, or delete. Specify a group name to view a list of users in a group only.

/comment:"<Text>"

Adds a comment for a new or existing group. The comment can have as many as 48 characters. Enclose the text in quotation marks.

/domain

Performs the operation on the domain controller in the current domain. Otherwise, the operation is performed on the local computer.

/add

Adds a group, or adds a user name to a group. You must establish accounts for users that you add to a group with this command.

/delete

Removes a group, or removes a user name from a group.

<UserName>[ ...]

Lists one or more user names to add to or remove from a group. Separate multiple user names with a space.

net help <command>

Displays help for the specified net command.

Remarks

  • When you use net group without parameters, this command displays the name of a server and the names of groups on the server.

  • You can also type net groups to get the same output.

  • You can use net group to group users who use the network in the same or similar ways. When you assign rights to a group, each member of the group automatically has those rights. In the command output, net group precedes groups that include both users and groups with an asterisk (*).

    The net group output of groups on the server is similar to the following:

    Group Accounts for \\PRODUCTION
    ----------------------------------------------
    *Domain Admins           *Domain Users
    

Examples

This example lists all the groups on the local server:

net group

This example adds a group called Exec to the local user accounts database:

net group exec /add

This example adds a group called Exec to the domain database:

net group exec /add /domain

This example adds the existing user accounts estherv, ralfr, and stevent to the Exec group on the local computer:

net group exec estherv ralfr stevent /add

This example adds the existing user accounts estherv, ralfr, and stevent to the Exec group in the domain database:

net group exec estherv ralfr stevent /add /domain

This example displays users in the Exec group:

net group exec

This example adds a comment to the Exec group record:

net group exec /comment:"The executive staff"

Additional references

Command-Line Syntax Key