title: GCP: List members of all groups in an organization using gcloud CLI, output to BigQuery
body: <p>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.</p>
  <p>I know it involves &quot;gcloud identity groups memberships list&quot; but not clear on how to iterate through the groups and generating the output as CSV.</p>
  <p>I have already found a method to iterate through the projects and get the iam bindings for each - <a href="https://rajathithanrajasekar.medium.com/google-cloud-iam-users-extraction-across-all-projects-in-a-gcp-org-2fbe66ddc045" rel="nofollow noreferrer">https://rajathithanrajasekar.medium.com/google-cloud-iam-users-extraction-across-all-projects-in-a-gcp-org-2fbe66ddc045</a> Therefore I only need group membership info, not policy/binding info.</p>
  <p><strong>Update to clarify:</strong>
  Our users are assigned to IAM groups at the Org level (<a href="https://console.cloud.google.com/iam-admin/groups" rel="nofollow noreferrer">https://console.cloud.google.com/iam-admin/groups</a>). 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.</p>
  <p>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.</p>