The groupinfo command displays information on a single group or all groups, adds or deletes groups, and updates group information. All forms of the groupinfo command manage information on both local and global groups.
groupinfo can take three forms:
The first -- given none of the add (
-a), update ( -u), or delete ( -d) options -- displays information on the specified group or, if no group is specified, all groups on your system.
If the add (
-a) or update ( -u) options are used with groupinfo, groups must be specified on the command line. The given fields are added or updated.
If neither of the above forms of groupinfo is used,
the delete (
-d) operation must be specified. Each group given on the command line is deleted.
In Active Directory/domain terms, there are three kinds of groups: local,
global, and universal.
The groupinfo utility treats "domain global" and "domain
universal" groups the same and can access such groups using the
There is no such thing as a "machine global" group.
adds a group. Each specified group-name is added. If any
-foptions are given in conjunction with this option, they apply to all groups added. -b
produces brief output. One line of output is displayed for each group with just the name and description of the group list.
deletes a group. Each specified group-name is deleted.
locates the primary domain controller of the specified domain-name, and requests that machine to perform the actions on behalf of the groupinfo command. groupinfo normally performs actions on the local system.
-Dand -Soptions are mutually exclusive.
To operate on the global groups of the domain controller, you must also specify the
-goption; otherwise, groupinfo operates on the domain conntroller's local groups. -e
displays the error number contained in the errno variable for any system error that occurs and exits. You can use the strerror utility to display the system error message corresponding to this error number.
assigns value to the specified fieldname. The following fieldnames are currently accepted:
Comment Comment associated with the group.
For a more complete description of these fields, consult the 7/2008R2/8/2012/10/2016/2019 administrative documentation.
operates on the global groups.
-land -gare mutually exclusive options. If neither the -lnor -goptions are specified, the default is to operate on the local groups. -l
operates on the local groups.
displays a single line for each specified group, containing a tab separated list of all group members. If no options are specified, the default display format is verbose.
Note that user and group names may have spaces in them.
requests that the specified host perform the actions on behalf of the groupinfo command. groupinfo normally performs actions on the local system. Optionally, hostname may be preceded by \\ or //.
-Dand -Soptions are mutually exclusive. -s
sorts group list.
When using the
-soption with the -boption to produce a sorted brief list of groups, the list is actually generated faster than just using the -boption. -u
updates a group. Each specified group-name has one or more fields updated. The fields to update are specified with
displays a single line for each specified group, containing the group name and comment separated by tabs. If no options are specified, the default display format is verbose.
The following script takes all the members of a group on another host, and adds them to the same group locally.
group=accounting # Specifies the group remote=acctsrv1 # Specifies the remote host IFS='<TAB>' # Note that groupinfo may return user names # with spaces in them! This protects these # names from being split by the for command. for user in $(groupinfo -S '\\'$remote -m $group) do member -g $group -a $user done
Possible exit status values are:
Windows 7. Windows Server 2008 R2. Windows 8. Windows Server 2012. Windows 10. Windows Server 2016. Windows Server 2019.
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.2 Documentation Build 28.