turbot/googleworkspace
steampipe plugin install googleworkspace

Table: googleworkspace_people_contact_group - Query Google Workspace People Contact Groups using SQL

Google Workspace People Contact Groups is a feature within Google Workspace that allows users to create and manage groups of contacts. It offers a centralized way to organize and manage contacts for various Google Workspace applications, including Gmail, Google Meet, and more. People Contact Groups help users efficiently manage communications and collaborations with groups of people.

Table Usage Guide

The googleworkspace_people_contact_group table provides insights into People Contact Groups within Google Workspace. As an IT administrator or a Google Workspace user, you can explore group-specific details through this table, including group metadata, member count, and member resource names. Use it to manage and organize your Google Workspace contacts more efficiently, such as identifying large groups, finding groups without members, and understanding the structure of your contact groups.

Examples

Basic info

Explore the various contact groups in your Google Workspace, including their names and types, to better manage your organization's communication and collaboration. This can be particularly useful in large organizations where understanding group structures is key to efficient operations.

select
resource_name,
name,
formatted_name,
group_type
from
googleworkspace_people_contact_group;
select
resource_name,
name,
formatted_name,
group_type
from
googleworkspace_people_contact_group;

List deleted contact groups

Discover the segments that have been removed from your Google Workspace contact groups. This can be useful to track changes and manage your contacts more effectively.

select
resource_name,
name,
formatted_name,
deleted
from
googleworkspace_people_contact_group
where
deleted;
select
resource_name,
name,
formatted_name,
deleted
from
googleworkspace_people_contact_group
where
deleted = 1;

List members in each contact group

Explore which members belong to each contact group in your Google Workspace, allowing you to better manage communication and collaboration within your organization. This query is particularly useful for gaining insights into group composition and identifying any necessary changes to group membership.

select
cg.name as contact_group_name,
c.given_name as member_name,
c.primary_email_address as member_primary_email
from
googleworkspace_people_contact_group as cg,
jsonb_array_elements_text(member_resource_names) as m_name,
googleworkspace_people_contact as c
where
c.resource_name = m_name;
select
cg.name as contact_group_name,
c.given_name as member_name,
c.primary_email_address as member_primary_email
from
googleworkspace_people_contact_group as cg,
json_each(cg.member_resource_names) as m_name,
googleworkspace_people_contact as c
where
c.resource_name = m_name.value;

Get member count for each contact group

Discover the segments that have varying membership within your contact groups. This query allows you to analyze the size of each group, helping you to better manage your resources and communications.

select
resource_name,
name,
formatted_name,
member_count
from
googleworkspace_people_contact_group;
select
resource_name,
name,
formatted_name,
member_count
from
googleworkspace_people_contact_group;

Schema for googleworkspace_people_contact_group

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
client_datajsonbThe group's client data.
deletedbooleanIndicates whether the contact group resource has been deleted, or not.
formatted_nametextThe name translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale for system groups names.
group_typetextThe contact group type.
max_membersbigint=Specifies the maximum number of members to return. Default is 2500, if no value provided.
member_countbigintThe total number of contacts in the group irrespective of max members in specified in the request.
member_resource_namesjsonbA list of contact person resource names that are members of the contact group.
nametextThe contact group name set by the group owner or a system provided name for system groups.
resource_nametextThe resource name for the contact group, assigned by the server.
updated_timetimestamp with time zoneThe time the group was last updated.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- googleworkspace

You can pass the configuration to the command with the --config argument:

steampipe_export_googleworkspace --config '<your_config>' googleworkspace_people_contact_group