#!/bin/bash
DATE=`date +%Y-%m-%d`
FORWARDSLOGFILE=“./logs/"$DATE"_email_forwards_update.txt"
/bin/killall ~/bin/gamadv-xtd3/gam > $FORWARDSLOGFILE 2>&1
/bin/killall gam >> $FORWARDSLOGFILE 2>&1
#get the forwarding
/home/app_gam/bin/gamadv-xtd3/gam config csv_output_row_filter "forward:regex:^.+$" csv_output_header_filter "User,forward,markread,archive,trash" auto_batch_min 1 num_threads 40 redirect csv - multiprocess todrive tdfileid 'FILE_ID_REDACTED' tdretaintitle tdsheet "Filter forwards" all users print filters >> $FORWARDSLOGFILE 2>&1
/home/app_gam/bin/gamadv-xtd3/gam config csv_output_row_filter "forwardTo:regex:^.+$" auto_batch_min 1 num_threads 40 redirect csv - multiprocess todrive tdfileid 'FILE_ID_REDACTED' tdretaintitle td
sheet "Settings forwards" all users print forwards >> $FORWARDSLOGFILE 2>&1
#copy the filter forwards to make a day-by-day set of sheets for historical purposes
/home/app_gam/bin/gamadv-xtd3/gam user ad...@example.edu copy drivefile 'FILE_ID_REDACTED' newfilename $DATE" Filter forwards" parentid FOLDER_ID_REDACTED >> $FORWARDSLOGFILE 2>&
1
#copy the settings Forwards
/home/app_gam/bin/gamadv-xtd3/gam user ad...@example.edu copy drivefile 'FILE_ID_REDACTED' newfilename $DATE" Settings forwards" parentid FOLDER_ID_REDACTED >> $FORWARDSLOGFILE 2
>&1
#UPDATE THE LIST OF OUS VS. PEOPLE
/home/app_gam/bin/gamadv-xtd3/gam print users ou todrive tdfileid 'FILE_ID_REDACTED' tdretaintitle tdsheet "example.edu - Users by OU" >> $FORWARDSLOGFILE 2>&1
cat "$FORWARDSLOGFILE" | /usr/bin/tr -d '[\200-\377]' | /usr/bin/tr '\015' '\n' | /bin/grep -B2 -A3 "Data uploaded to Drive File" | /bin/mail -s "Email Forwards Reporting Results for $DATE" us...@example.edu,gro...@lists.example.edu
/bin/find /home/app_gam/email_forwards/logs -mtime +1 -empty -delete >> “./logs/"$DATE"_delete-empty-email-forwards-logs.txt" 2>&1
/bin/find /home/app_gam/email_forwards/logs -mtime +2 -exec /bin/gzip {} \; >> “./logs/"$DATE"_gzip-email-forwards-logs.txt" 2>&1
On Sep 14, 2023, at 12:29 PM, Steven Clayton <scla...@mka.org> wrote:
I found some suggested commands but none seem to work on my end. We are trying to determine which users have enabled mail forwarding and cant seem to be able to do it from Admin Console, looks like GAM should be able to, but I could some help with the proper command syntax. Running GAM on a Mac if it makes any difference.
This message was sent from an official MKA email account.
--
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/d24faa2d-482d-4280-8819-e5723567bdadn%40googlegroups.com.
On Sep 14, 2023, at 12:29 PM, Steven Clayton <scla...@mka.org> wrote:
I found some suggested commands but none seem to work on my end. We are trying to determine which users have enabled mail forwarding and cant seem to be able to do it from Admin Console, looks like GAM should be able to, but I could some help with the proper command syntax. Running GAM on a Mac if it makes any difference.
This message was sent from an official MKA email account.
gam ou "<name of OU>" show forwardingaddress, you should get a list of established forwarding addresses. I'll use "students" as my OU:gam ou "students" show forwardingaddress
gam user mort@unseenuniversity.edu show forwardUser: mort@unseenuniversity.edu, Forward Enabled: False|True
# User: mort@unseenuniversity.edu, Show 3 Forwarding Addresses (4/19)# Forwarding Address: rinc...@unseenuniversity.edu, Verification Status: accepted (1/3)# Forwarding Address: bur...@braseneckcollege.edu, Verification Status: accepted (2/3)# Forwarding Address: mus...@unseenuniversity.edu, Verification Status: accepted (3/3)
I found some suggested commands but none seem to work on my end. We are trying to determine which users have enabled mail forwarding and cant seem to be able to do it from Admin Console, looks like GAM should be able to, but I could some help with the proper command syntax. Running GAM on a Mac if it makes any difference.
This message was sent from an official MKA email account.
--
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAHcQ0DRFOuGZpH4HehOKwewhU9cnhXh3PsUFiQWxkKFe%3D%3DqUuw%40mail.gmail.com.
gam ou "students" show forwardingaddress (This gave me ZERO results)
gam ou "students/ClassOf2029" show forwardingaddress. (This listed EVERY SINGLE Student in this OU
Here's an Advanced Gam solution that should do what you want: see: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Forwardinggam ou_and_children "students" show forwardingaddress
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/76739aa9-2c1e-4488-9966-5681903ad78fn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/-5Q4lCYLdiE/unsubscribe.
To unsubscribe from this group and all its topics, 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/761ABF64-F10B-44C5-BCD6-9E8CAD14E9ED%40gmail.com.