Reporting on drive events by owner for users in an OU

155 views
Skip to first unread message

Aaron Smith

unread,
Nov 22, 2023, 3:47:06 PM11/22/23
to GAM for Google Workspace
I need to run a report for drive events by OU and by owner. I am wanting to find files and folders that still have people viewing and editing them even though the owner of the file has a suspended account.

I have 2 GAM commands that I have been working on but neither one is giving me exactly what I need.

  • The first one returns all of the drive events were the users in the OU are Actors, but I need to see the drive events where all of those users are owners.
gam report drive OU <OU-Path> events view,edit

  • The second command returns all of the users but fails to pass the primaryEmail to the second part of the command. In the second part of the command I am able to specify a single email address which returns what I am looking for however I need this to be dynamic so that it ban repeated for all accounts in the OU.
gam print users query "orgUnitPath='/Path/To/OU'" | gam csv - gam report drive filter "owner==~primaryEmail" events edit,copy,download,print,view todrive

Any idea?

Thanks



Ross Scroggs

unread,
Nov 22, 2023, 3:58:50 PM11/22/23
to google-ap...@googlegroups.com
Aaron,

Correction, use ~~ ariunf primaryEmail
gam print users query "orgUnitPath='/Path/To/OU'" | gam csv - gam report drive filter "owner==~~primaryEmail~~" events edit,copy,download,print,view todrive

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/3b802131-245a-407c-b876-539382b779ddn%40googlegroups.com.

Aaron Smith

unread,
Nov 22, 2023, 4:13:05 PM11/22/23
to GAM for Google Workspace
Excellent! Thank you that worked!

Aaron Smith

unread,
Nov 28, 2023, 3:16:33 PM11/28/23
to GAM for Google Workspace
Would you happen to know how I could append each of those reports so the output appears in a single Google Sheet instead of multiple Google sheets? Right now it is creating a google sheet for each person that owns a file.

Ross Scroggs

unread,
Nov 28, 2023, 3:33:21 PM11/28/23
to google-ap...@googlegroups.com
Aaron,


gam print users query "orgUnitPath='/Path/To/OU'" | gam redirect csv - multiprocess todrive csv - gam report drive filter "owner==~~primaryEmail~~" events edit,copy,download,print,view

Ross
----
Ross Scroggs



Aaron Smith

unread,
Dec 1, 2023, 3:48:11 PM12/1/23
to GAM for Google Workspace
Thanks once again. That worked perfectly!
Reply all
Reply to author
Forward
0 new messages