Adding users and domain groups to local groups is easy with the GUI. However the GUI will not add local groups to existing groups. You must use the NET command for that.
In order to add a local group to another group you need to use the NET localgroup command.
The syntax of this command is:
NET LOCALGROUP
[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]
NET LOCALGROUP modifies local groups on computers. When used without
options, it displays the local groups on the computer.
groupname Is the name of the local group to add, expand, or
delete. Supply only a groupname to view a list of
users or global groups in a local group.
/COMMENT:"text" Adds a comment for a new or existing group.
Enclose the text in quotation marks.
/DOMAIN Performs the operation on the domain controller
of the current domain. Otherwise, the operation is
performed on the local workstation.
name [ ...] Lists one or more usernames or groupnames to add or to
remove from a local group. Separate multiple entries with
a space. Names may be users or global groups, but not
other local groups. If a user is from another domain,
preface the username with the domain name (for
example, SALES\RALPHR).
/ADD Adds a groupname or username to a local group. An account
must be established for users or global groups added to a
local group with this command.
/DELETE Removes a groupname or username from a local group.
NET HELP command | MORE displays Help one screen at a time.
To add the local “Target Group” to the source group, the format is the following:
Net localgroup "Target Group" "Source Group" /add
You can also use this in a script to add or remove groups.
Reference:
Adding a Windows Built-In Group to a Local Group
Leave a Reply
You must be logged in to post a comment.