Reporting on nested Google Groups

1,176 views
Skip to first unread message

PeterA

unread,
Jul 13, 2018, 6:40:00 AM7/13/18
to GAM for G Suite
I'm trying to track down a command that will spit out a group then it's nested groups in a hierarchical format.

I've been using GAMADV-X and tried: gam print group-members select gr...@domain.com recursive

Problem with that is that it gives me everything in one column, with only the top level group being shown as the 'parent'

I've tried querying out the results, but I can't draw any direct correlation between a subgroup and it's parent subgroup leading back to the root. I end up with something like this:

MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
OWNERtoplevelgroup@user@USERACTIVE1SubGroup@user@OWNER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE1SubGroup@user@MEMBER
subgrouplevel1@
MEMBERtoplevelgroup@user@USERACTIVE0SubGroup@
MEMBERtoplevelgroup@user@USERACTIVE0SubGroup@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
OWNERtoplevelgroup@user@USERACTIVE3SubGroup@user@OWNER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
OWNERtoplevelgroup@user@USERACTIVE3SubGroup@user@OWNER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@
MEMBERtoplevelgroup@user@USERACTIVE3SubGroup@user@MEMBER
subgrouplevel3@

Has anyone faced a similar challenge and cracked it?

Thanks in advance!

Ross Scroggs

unread,
Jul 13, 2018, 9:20:34 AM7/13/18
to google-ap...@googlegroups.com
Peter,


Try this: gam show group-members select gr...@domain.co
This command is recursive by default, you can limit the depth with depth <n>

Top level only:
$ gam show group-members select  testgroup1 depth 0
  OWNER, USER, ad...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, GROUP, testg...@rdschool.org, ACTIVE
All the way down:
$ gam show group-members group testgroup1
  OWNER, USER, ad...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, USER, test...@rdschool.org, ACTIVE
  MEMBER, GROUP, testg...@rdschool.org, ACTIVE
    MEMBER, GROUP, testg...@rdschool.org, ACTIVE
      OWNER, USER, test...@rdschool.org, ACTIVE
      MEMBER, GROUP, testg...@rdschool.org, ACTIVE
        OWNER, USER, test...@rdschool.org, ACTIVE

The contents of this message and any attachments to it are private, confidential and may be the subject of legal privilege. Telegraph Media Group Limited is registered in England and Wales (company number 451593) at 111 Buckingham Palace Road, London, SW1W 0DT. If you are not the intended recipient of this email please inform us and the sender immediately. You must not take any action based upon the contents of this email, nor copy it or show it to anyone. Any unauthorised disclosure, use or dissemination of the whole or part of the message contained in such email is prohibited. Any views or opinions expressed do not necessarily represent those of Telegraph Media Group Limited. It is the recipient’s responsibility to carry out any virus checking.



-- 
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/19a55016-0c07-49b2-b74d-8f30df9e4f95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PeterA

unread,
Jul 13, 2018, 9:48:41 AM7/13/18
to GAM for G Suite
Thanks (again!) Ross. Turns out I was using text to columns in the wrong way after capturing that show to a csv.

I was separating by commas, but the way this report comes out I had to separate by spaces and deselect treat consecutive delimiters as one.

That's given me an actual hierarchy.

All the best,
Peter
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Dennis M

unread,
Mar 26, 2020, 3:36:04 PM3/26/20
to GAM for G Suite
Hey Peter,

Were you brining this into excel or google sheets or something else? 

I am trying to pull it into google sheets and keep the spacing but I cant figure out how

Dennis M

unread,
Mar 26, 2020, 10:21:33 PM3/26/20
to GAM for G Suite
Figured i would answer my own question..
I printed the output using the command

gamadvx show group-members group GROUPNAME@DOMAIN depth 10 >> Testfile


which I then used BBEdit to Find and Replace the Tabs with commas, that way when importing into google sheets everything imported right!

Reply all
Reply to author
Forward
0 new messages