# Cloud Identity Groups - Membership - [API documentation](#api-documentation) - [Python Regular Expressions](Python-Regular-Expressions) Match function - [Definitions](#definitions) - [Notes](#Notes) - [Collections of Users](#collections-of-users) - [Add members to a group](#add-members-to-a-group) - [Delete members from a group](#delete-members-from-a-group) - [Synchronize members in a group](#synchronize-members-in-a-group) - [Delete members from a group by role](#delete-members-from-a-group-by-role) - [Update member roles and expiration time](#update-member-roles-and-expiration-time) - [Bulk membership changes](#bulk-membership-changes) - [Display user group member options](#display-user-group-member-options) - [Display group membership in CSV format](#display-group-membership-in-csv-format) - [Display group membership in hierarchical format](#display-group-membership-in-hierarchical-format) ## API documentation * [Cloud Identity Groups Overview](https://cloud.google.com/identity/docs/groups) * [Cloud Identity Groups API - Groups](https://cloud.google.com/identity/docs/reference/rest/v1/groups) * [Cloud Identity Groups API - Membership](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships) * [Cloud Identity Groups](https://gsuiteupdates.googleblog.com/2020/08/new-api-cloud-identity-groups-google.html) * [Security Groups](https://gsuiteupdates.googleblog.com/2020/09/security-groups-beta.html) ## Notes In the Admin Directory API a group has the following characteristics: * `id` - The unique ID of a group * `email` - The group's email address * `name` - The group's display name In the Cloud Indentity Groups API a group has the following characteristics: * `name` - The unique ID of a group * `groupKey.id` - The group's email address * `displayName` - The group's display name The Admin Directory API group characteristic names will be used. Dynamic Groups require Cloud Identity Premium accounts. * https://cloud.google.com/identity/docs/how-to/create-dynamic-groups The `cimember ` option of `gam print|show cigroup-members` requires a Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. * https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships/searchTransitiveGroups ## Definitions ``` ::= ::= id:cbcm-browser. ::= id:chrome-os-device. ::= "(|)(,(|))*" ::= (.)+ ::= @ ::= id: ::= ||groups/ ::= "(,)*" ::= | | | See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items ::= owner|manager|member ::= "(,)*" ::= cbcmbrowser|chromeosdevice|customer|group|other|serviceaccount|user ::= "(,)*" ::= createtime email|useremail| expiretime| memberkey| name| preferredmemberkey| role| type| updatetime ::= "(,)*" ::= See: https://docs.python.org/3/library/re.html ::= ::= ::= > ``` ## Collections of Users Group membership commands involve specifying collections of users or lists of browsers/devices; for ``, see: [Collections of Users](Collections-of-Users) ## Add members to a group ``` gam update cigroups create|add [] [usersonly|groupsonly] [notsuspended|suspended] [notarchived|archived] [expire|expires