I would like to use the gcloud CLI to create a table of all users in Google IAM groups in our organziation, and output to a BQ table.
I know it involves "gcloud identity groups memberships list" but not clear on how to iterate through the groups and generating the output as CSV.
I have already found a method to iterate through the projects and get the iam bindings for each - https://rajathithanrajasekar.medium.com/google-cloud-iam-users-extraction-across-all-projects-in-a-gcp-org-2fbe66ddc045 Therefore I only need group membership info, not policy/binding info.
Update to clarify: Our users are assigned to IAM groups at the Org level (https://console.cloud.google.com/iam-admin/groups). I am looking to generate a list in BigQuery of these memberships, so that we don't have to hunt through them looking for where a user might be found.
The team managing permissions does not have Google Workspace admin to see group membership by user, so we are looking for a way to provide this information.