Logging GAM commands/runs

1,711 views
Skip to first unread message

Rodney Dore

unread,
May 9, 2017, 5:49:41 AM5/9/17
to GAM for G Suite
Good morning all

A client is looking for the ability to run GAM and log the results in a text file or drive that would have a legible history.   Right now something like this is not really usable for a log file:  gam user user...@domain.com show delegates >>log.txt and then run another command to that log file and you can not tell what time or date things ran.  

My client is going to use GAM to on-board students to their alumni domain. The client is looking for detailed information out of the gam logging process (as in, if something fails, show us, and perhaps a timestamp for when things occur), or if we can make an external mechanism for error logging? It is important that when we run, say, a 600 user CSV we know exactly how many were created and which ones were not.

Also, unrelated to what I am doing, this would be useful since not all commands are in the G Suite Admin reports.

Any advice or direction would be appreciated.  

Rodney Dore

✉ Kevin Melillo

unread,
May 9, 2017, 8:27:37 AM5/9/17
to google-ap...@googlegroups.com
When we onboard or offboard users, I use a bash script to pull information from a source csv file.  I also output the commands I am using to a log file, so I have a record of it.  

I create a timestamp at the beginning of the bash script.

timestamp=$(date +%Y-%m-%d@%I:%M%p)

Then after each GAM command I run, I usually add a command to write to a log file..  similar to this.

echo "* $timestamp * $tUser - created ($tOrg)" >> files-log/gam-data.log

That way I can always go back and check the logs for any work I have done via GAM.

It will also show in the admin panel logs as 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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@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/11bafcac-0003-4952-b02b-3ad873e87472%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331

Rodney Dore

unread,
May 9, 2017, 9:20:47 AM5/9/17
to google-ap...@googlegroups.com
Thanks Kevin

I'll take a shot at it.  

Onix
Rodney Dore 
Cloud Services Manager
18519 Detroit Ave., Lakewood, OH 44107

On Tue, May 9, 2017 at 8:27 AM, ✉ Kevin Melillo <k.me...@ieee.org> wrote:
When we onboard or offboard users, I use a bash script to pull information from a source csv file.  I also output the commands I am using to a log file, so I have a record of it.  

I create a timestamp at the beginning of the bash script.

timestamp=$(date +%Y-%m-%d@%I:%M%p)

Then after each GAM command I run, I usually add a command to write to a log file..  similar to this.

echo "* $timestamp * $tUser - created ($tOrg)" >> files-log/gam-data.log

That way I can always go back and check the logs for any work I have done via GAM.

It will also show in the admin panel logs as well.
On Tue, May 9, 2017 at 5:49 AM, 'Rodney Dore' via GAM for G Suite <google-apps-manager@googlegroups.com> wrote:
Good morning all

A client is looking for the ability to run GAM and log the results in a text file or drive that would have a legible history.   Right now something like this is not really usable for a log file:  gam user user...@domain.com show delegates >>log.txt and then run another command to that log file and you can not tell what time or date things ran.  

My client is going to use GAM to on-board students to their alumni domain. The client is looking for detailed information out of the gam logging process (as in, if something fails, show us, and perhaps a timestamp for when things occur), or if we can make an external mechanism for error logging? It is important that when we run, say, a 600 user CSV we know exactly how many were created and which ones were not.

Also, unrelated to what I am doing, this would be useful since not all commands are in the G Suite Admin reports.

Any advice or direction would be appreciated.  

Rodney Dore

--
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-manager+unsubscribe...@googlegroups.com.
--
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331

--
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
Reply all
Reply to author
Forward
0 new messages