Admin Tip #287: Windows NT Resource Kit utility USRTOGRP.EXE useful for adding users to local or global groups

Hits: Failed to execute CGI : Win32 Error Code = 3


Windows NT gui tool, User Manager, is adequate for adding a few user accounts and for adding users to local or global groups. It is simply too clumsy for managing large number of accounts. Windows NT Resource Kit utility ADDUSERS.EXE to allow commandline create of accounts, allowing for scripting solutions. Windows NT Resource Kit utility USRTOGRP.EXE allows one to automate group membership. USRTOGRP takes its commands from a text file with the following syntax:

DOMAIN: mydomain
LOCALGROUP: alocalgroup
FirstUser
SecondUser
GLOBALGROUP: aglobalgroup
Firstmember
Secondmember

The DOMAIN: can be a memberserver or workstation as in \\SRVR2.

If you don't have the Resource Kit, the net localgroup command has signficant functionality. The syntax 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. 
                 This parameter applies only to Windows NT 
                 Workstation computers that are members of 
                 a Windows NT Server domain. By default, 
                 Windows NT Server computers perform 
                 operations on the primary domain controller. 
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.




Must have for NT administrators