List Group Members
Definition
The "List Group Members" action retrieves a paginated list of all members in a specific group within Google Directory. This action allows you to access detailed information about group members, such as their roles, statuses, and email delivery preferences. It supports filtering by member role (OWNER, MANAGER, MEMBER) and can include indirect (derived) memberships if specified. Additionally, it enables navigation through large datasets by using a next-page token, ensuring that you can fetch all members of large groups in multiple requests. This action is particularly useful for managing and auditing group memberships in Google Workspace environments.
Example Use Cases
1. Managing Group Memberships
HR or IT teams can use this action to retrieve and manage the members of a specific group within Google Directory, including roles, statuses, and email preferences.
Example: IT retrieves all members of the "Marketing Team" group and updates email delivery preferences.
2. Auditing Group Roles
Organizations can perform audits to ensure proper role assignments within groups, ensuring only authorized users have admin or manager roles.
Example: Security team retrieves all members with the "Owner" role to ensure no unauthorized users have elevated permissions.
3. Handling External Members
Teams can retrieve and review external members (users from outside the domain) in a group, ensuring appropriate permissions and access controls.
Example: Project managers audit external collaborators in the "Client Collaboration" group to verify access levels.
4. Large Group Member Listings
For large groups, this action helps list members across multiple pages by using a next-page token, making it easier to manage or track membership in large organizations.
Example: Admin retrieves members of a global organization’s "Company-wide Announcements" group and fetches data page by page.
5. Monitoring Member Statuses
This action can be used to monitor the current status of members in a group (ACTIVE, SUSPENDED, etc.), ensuring that only active users are part of critical groups.
Example: IT checks for any suspended members in the "IT Support" group to take action if necessary.
Inputs
1. Connection
This field refers to the established connection to your Google Workspace account. It allows Zenphi to access your Google Directory and perform actions related to the group and its members.
Explanation: You must configure a Google Workspace connection in Zenphi before using this action. Ensure that the connection has the necessary permissions to view group memberships.
Best Practices: Always verify that the connection is active and has sufficient admin permissions before proceeding with any actions.
2. Group Key
The unique identifier for the group. This can be the group's email address, group alias, or the unique group ID.
Explanation: This value specifies which group you want to retrieve members from. It can be one of the following:
- Group's email address (e.g.,
[email protected]
) - Group alias (e.g.,
[email protected]
) - Unique Group ID (e.g.,
[email protected]
)
Best Practices: Ensure you input the correct identifier for the group to avoid retrieval errors. If using a group alias or email, confirm the alias is valid and corresponds to an actual group.
3. Roles (Optional)
Allows filtering of group members by their role within the group. This field supports three values: OWNER, MANAGER, MEMBER.
Explanation: If specified, only members with the listed roles will be included in the results.
Best Practices: Use this field to focus on specific roles (e.g., "OWNER" for administrative roles) when auditing group memberships. If left empty, the action retrieves all members.
4. Include Derived Membership (Optional)
Specifies whether to include indirect members of the group (i.e., members that belong to subgroups within the main group).
Explanation: If set to true, the action will include all derived members. By default, this value is false, meaning only direct members will be retrieved.
Best Practices: Enable this if you want to capture all members, including those that are part of nested groups. Otherwise, leave it set to false to retrieve only direct members.
5. Next Page Token (Optional)
A token used for pagination. If the group has more members than can be returned in a single request, this token allows you to fetch additional pages of members.
Explanation: If your query has more results than can be shown on one page, the response will include a nextPageToken. You can use this token in subsequent requests to continue retrieving members.
Best Practices: If you're dealing with large groups, remember to capture and pass the nextPageToken to load additional results.
Outputs
1. Number of Licenses
This field returns the number of licenses associated with the members in the group.
Explanation: It gives you a count of the total licenses available for the group members based on their roles or status. This is useful for auditing and managing resource allocations within Google Workspace.
Example: If a group has 10 members and all are assigned licenses, the output would show "10".
2. Group Members
This field returns a list of all members of the group, including their specific details.
Explanation: It provides information about each member in the group, including the following sub-fields:
-
Member Id: The unique ID of the group member, which can be used as a reference in further actions. This ID is specific to the member within the group.
Example:
12345
(this can be used to query additional details about a specific member). -
Email: The email address of the group member.
Example:
[email protected]
-
Role: The role of the member within the group. Possible values include OWNER, MANAGER, or MEMBER.
Example:
OWNER
-
Type: The type of the member, indicating whether they are a USER, GROUP, EXTERNAL, or CUSTOMER.
Example:
USER
orEXTERNAL
-
Status: The current status of the member, which can be ACTIVE, ARCHIVED, SUSPENDED, or UNKNOWN.
Example:
ACTIVE
-
Delivery Setting: Defines the mail delivery preference for the group member. Possible values include:
- ALL_MAIL (all messages, delivered immediately)
- DAILY (one summary email per day)
- DIGEST (up to 25 messages bundled into one)
- DISABLED (no messages delivered)
- NONE (no emails sent)
Example:
DAILY
3. Next Page Token
A token used for paginating results. If the result set exceeds the maximum number of items that can be displayed on one page, this token helps to retrieve the next set of members.
Explanation: If there are more members than can be returned in a single request, a nextPageToken will be provided. This token can be used in a subsequent request to fetch the next page of results.
Example: abc123token
(use this token to retrieve the next page of data when it's available).
Example Scenario
Scenario: Managing Group Members in a Large Organization
Background:
Imagine a company, TechCorp, that has multiple teams working on different projects. One of the teams, the Marketing Team, has a large Google Group with members from various departments. The HR department wants to track who belongs to the Marketing Group and their respective roles for a quarterly report.
Steps:
-
Connecting to Google Directory:
The HR team sets up the Google Directory Connection in Zenphi to link with their Google Workspace account. -
Choosing the Group Key:
HR wants to retrieve the members of the Marketing Team group. They have the group email,[email protected]
, so they input this value as the Group Key in the action. -
Setting Up Roles Filter:
HR decides they only need to check the roles of MANAGER and MEMBER in the group. So, they add these roles as comma-separated values in the Roles field (i.e.,MANAGER,MEMBER
). -
Optional Parameters:
Since HR is only interested in the current direct members and not indirect memberships (members from subgroups), they leave the Include Derived Membership field set to false. For the Next Page Token, HR doesn't need it initially since they want to retrieve the first page of members. -
Running the Action:
HR runs the action, and the system returns a paginated list of all MANAGER and MEMBER roles within the Marketing Team group. -
Reviewing the Outputs:
The output contains:- Number of Licenses: Indicates how many licenses are assigned to group members (e.g., 25).
- Group Members: A detailed list of each group member, including:
- Member Id, Email, Role (e.g.,
MANAGER
orMEMBER
), Status (e.g.,ACTIVE
), and Delivery Setting (e.g.,DAILY
).
- Member Id, Email, Role (e.g.,
- Next Page Token: If there are more members to retrieve, the action will return a Next Page Token.
-
Paginated Data:
If the group has more members than can fit on one page, HR can use the Next Page Token in a subsequent request to get the next batch of members.
Outcome:
HR can now easily access the complete list of MANAGER and MEMBER roles in the Marketing Team Google Group. This data can be used for reporting, audits, or managing team structure changes.
This workflow helps HR and the team leads stay organized and maintain control over membership roles within groups efficiently.
Updated 8 days ago