Summary

There is no command to list which users have a particular group assigned and neither FCC nor the old GUI have a way to list this information.

Procedure

Primary group definitions can be seen with listings of users:

  • Command line: lsbks -p
  • FCC: List -> Users -> Expand all
  • Old GUI: User Administration -> List User Data -> List (with "Long Listing" unchecked)

However, this is not a convenient way to find particular groups, as these commands are all user-centric.
The lsbks command provides the ability to pull the information needed using "-D" options:

Character Displays

l Username
g Numeric group ID
m Secondary UNIX groups or Windows local groups, separated with spaces, including groups inherited from user classes
U Secondary groups enabled for user? Yields "yes" or "no"

The -Dm option gives numeric GID, though this is not stated in the man page. This can be used to produce a simple report:

Here is an example with awk:

lsbks -DlgmU | \
awk 'BEGIN {print "User,Primary GID,Secondary GIDs,Group management enabled"}
{if($1 ~ /:/) printf("\n%s",$1)
else printf(",%s", $0)}
END {printf("\n")}'

This will produce a comma separated value (CSV) list of users with second column being primary GID, third column being a space separated list of secondary GIDs, for example:

User,Primary GID,Secondary GIDs,Group management enabled

UNIX_HOSTS:student3,3000,54321 3000,yes
UNIX_HOSTS:student4,3000,3000,yes
master:bccps,501,,no
master:root,0,,no

You can perform further processing or change the formatting if desired.


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: May 25, 2018