Using two CSV files?

41 views
Skip to first unread message

Carl Sundermann

unread,
Jul 12, 2024, 12:36:14 PM (5 days ago) Jul 12
to GAM for Google Workspace
Hello,

I am using Extended GAM. I use gam each summer to clean up aliases from name changes from the previous year.

I first print the list todrive, then remove ones I want to keep. Then I use this resulting CSV to run this:
gam csv aliases.csv gam delete alias ~Alias

Simple, and works well.

Because Google will leave the old alias in people's personal address books, sometimes we get a request to clean this up.  I do this on an individual request basis by doing this:

gam print group-members group distr...@wdmcs.org recursive noduplicates | gam csv - gam user ~email delete othercontacts emailmatchpattern oldpersonse...@wdmcs.org

In an effort to be more proactive, I'd like to do this for everyone and not wait for someone to ask. But I'm not sure how to combine these actions into one command, since I need to reference 2 csv files (the piped list of members from distr...@wdmcs.org and the aliases.csv file)

I realize I could manually combine the two csv files into one, but that will require more steps and I was hoping I could combine this all into one slick gam command.  So I tried this:

gam print group-members group distr...@wdmcs.org recursive noduplicates | gam csv - gam user ~email delete othercontacts emailmatchpattern gam csv aliasdelete2024.csv ~Alias

and that doesn't work, as it's trying to reference a second csv and that must not be how that works.

Does anyone have an idea of how I could accomplish this?

Thanks,

Carl

Ross Scroggs

unread,
Jul 12, 2024, 2:53:04 PM (5 days ago) Jul 12
to google-ap...@googlegroups.com
Send me a Meet/Zoom invitation.

Ross
----
Ross Scroggs



--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" 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/dfe4149f-a3d4-4cb4-a2c4-36631e7445e6n%40googlegroups.com.

Ross Scroggs

unread,
Jul 12, 2024, 3:05:13 PM (5 days ago) Jul 12
to google-ap...@googlegroups.com

gam aliases.csv gam group_users  distr...@wdmcs.org recursive delete othercontacts emailmatchpattern ~Alias

Ross
----
Ross Scroggs


On Jul 12, 2024, at 9:36 AM, Carl Sundermann <sunde...@wdmcs.org> wrote:

Ross Scroggs

unread,
Jul 15, 2024, 10:09:52 AM (2 days ago) Jul 15
to google-ap...@googlegroups.com
My mistake, try:
gam aliases.csv gam group_users  distr...@wdmcs.org recursive end delete othercontacts emailmatchpattern "~Alias"

Ross
----
Ross Scroggs


Carl Sundermann

unread,
Jul 15, 2024, 1:54:55 PM (2 days ago) Jul 15
to GAM for Google Workspace
Thank you, Ross.  With a minor modification of adding csv after the first GAM, it now works.  Thank you.

Ross Scroggs

unread,
Jul 15, 2024, 1:56:28 PM (2 days ago) Jul 15
to google-ap...@googlegroups.com
Carl,

Occasionally I get finger/brain disconnect, thanks for sorting the command out.

Roaa
----
Ross Scroggs



Reply all
Reply to author
Forward
0 new messages