I am using the gcloud beta command to search the groups in GCP.
The problem is I have 1700 groups, and after x number of groups command generates nextpagetoken and I have to enter it manually to rerun the command. Is there any way I can automate it? i.e, store the next page token in a variable and pass it to the following command.
gcloud beta identity groups search --organization="5487965215" --labels="cloudidentity.googleapis.com/groups.discussion_forum" --page-size=3
Implementation can be done in different ways, one of them using a while loop that retrieves
nextPageTokenfrom response.You can run this script on the Cloud Shell and change the Org ID. Group names will be saved on group.txt file