Net group


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

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


Copy Code

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


Copy Code

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

Examples

This example lists all the groups on the local server:


Copy Code

net group

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


Copy Code

net group exec /add

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


Copy Code

net group exec /add /domain

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


Copy Code

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:


Copy Code

net group exec estherv ralfr stevent /add /domain

This example displays users in the Exec group:


Copy Code

net group exec

This example adds a comment to the Exec group record:


Copy Code

net group exec /comment:"The executive staff"

Additional references

Command-Line Syntax Key