Find all groups a user is in

77 views
Skip to first unread message

Phyxiis

unread,
May 20, 2020, 11:07:05 AM5/20/20
to GAM for G Suite
Due to COVID, we are furloughing staff. The staff being furloughed must not have access to their email accounts. I have used GAM to create an export CSV of all email addresses and have trimmed it to just the furloughed staff so we can change their password and give delegate access to their managers. Also, these furloughed staff must be removed from all email groups temporarily until the furlough is lifted.

We need to make a CSV of all the groups a furloughed employee is in before we remove them from all groups, so that way when the furlough is lifted, we can easily know which groups to put the users back into.

I would like a CSV of each user (email address) in column A, and in the other columns B - nth, to be the groups the user is in.

For example:
Within the CSV I am importing there is the header: email and the data within that column are the furloughed employees email addresses

\location>gam CSV myfile.csv gam print users ~email groups todrive
Using 25 processes...

ERROR: firstname...@domain.ltd is not a valid argument for "gam print users"
...


I was able to run the below command and it worked, but it's not the format that we need.
gam print group-members todrive

Ross Scroggs

unread,
May 20, 2020, 1:55:44 PM5/20/20
to google-ap...@googlegroups.com
Phyxiis,

With Standard GAM you would do the following:
gam csv users.csv gam print users query "email=~~email~~" groups > usergroups.csv
Do not specify todrive, otherwise you will get a CSV file per user.
usergroups.csv will have a header row and a data row for each user.
Load usergroups.csv into Excel
Sort the rows and delete all of the extra header rows, leave one
Select column B, then use Data/Text to columns to split the cell into columns indicating that space is the delimiter
Add titles to B1, C1, D1, ...
Save the file and upload to a Google sheet

With Advanced GAM (https://github.com/taers232c/GAMADV-XTD3) you would do the following.
gam csvfile users.csv:email print users groupsincolumns todrive

Ross

MILWAUKEE ART MUSEUM
700 N. Art Museum Drive, Milwaukee, WI 53202
mam.org

Out of respect for the heightened concern around the coronavirus (COVID-19), the Museum is temporarily closed. 

Please visit mam.org for the latest updates—and explore mam.org/athome to watch our videos, listen to exhibition audio guides and podcasts, browse teacher resources, read articles, and more. We will continue to develop content that allows you to experience our rich creative history, dig deeper into topics of interest to you, and discover endless inspiration online. 

Be well.


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/5306c22d-582c-4ded-9338-601d1a851c82%40googlegroups.com.

Phyxiis

unread,
May 20, 2020, 2:00:52 PM5/20/20
to GAM for G Suite
Thank you I will give that a shot.

To install the advanced GAM, is it similar to how I ran the MSI for normal GAM?

Ross Scroggs

unread,
May 20, 2020, 2:21:55 PM5/20/20
to google-ap...@googlegroups.com
See: https://github.com/taers232c/GAMADV-XTD3/wiki/How-to-Upgrade-from-Standard-GAM
You'll use the same project, when prompted, say yiu're doing an upgrade.

MILWAUKEE ART MUSEUM
700 N. Art Museum Drive, Milwaukee, WI 53202
mam.org

Out of respect for the heightened concern around the coronavirus (COVID-19), the Museum is temporarily closed. 

Please visit mam.org for the latest updates—and explore mam.org/athome to watch our videos, listen to exhibition audio guides and podcasts, browse teacher resources, read articles, and more. We will continue to develop content that allows you to experience our rich creative history, dig deeper into topics of interest to you, and discover endless inspiration online. 

Be well.


--
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.
Reply all
Reply to author
Forward
0 new messages