GAM command for getting owner of Shared Drive

422 views
Skip to first unread message

Sandip Admin

unread,
Sep 12, 2023, 6:13:35 AM9/12/23
to GAM for Google Workspace
Hi Ross,

I need the details of owner (Who created the shared drive) of all the shared drives. I am using the advance GAM. Please share the GAM Command for the same.

Thanks and Regards,
Sandip

Temple Rodgers

unread,
Sep 12, 2023, 8:22:24 AM9/12/23
to GAM for Google Workspace

    gam print drivefileacls teamdrive "Teamdrive Name" pm role organizer em oneitemperrow

Temple Rodgers

unread,
Sep 12, 2023, 8:46:21 AM9/12/23
to GAM for Google Workspace
oops! for all drives it's either
gam print teamdriveacls pm role organizer em oneitemperrow
or
gam show teamdriveacls pm role organizer em oneitemperrow

you can go todrive, of course

Sandip Admin

unread,
Sep 12, 2023, 9:13:40 AM9/12/23
to GAM for Google Workspace
Hi Temple,

Thanks for your quick reply.

As per the given commands, it’s showing multiple organiser for one shared drive. But I need the details like who created the Shared Drive.

Thanks and Regards,
Sandip

Ross Scroggs

unread,
Sep 12, 2023, 9:33:18 AM9/12/23
to google-ap...@googlegroups.com
The information about who created a CSV file is not available via API. Temple's solution my help but the original organizer may have been replaced.

Ross

Disclaimers apply, for full details see: https://hackney.gov.uk/email-disclaimer

--
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/94984205-f51f-4892-8e67-338adf3e51f4n%40googlegroups.com.


--

Temple Rodgers

unread,
Sep 12, 2023, 10:17:27 AM9/12/23
to GAM for Google Workspace
it's interesting and sorry, @sandip, I missed your question!

An alternative approach is to look at Admin logs.
We have been keeping Admin logs in BigQuery for around 3 years .. I checked what I could find there. 
Drive records have many columns, there is an "event_name", which does have a value of "create". There's also a "drive.shared_drive_id"
So, I can write a simple query that will return the log of when the drive was created and who created it - provided that the Admin logs database goes back far enough. 

     SELECT TIMESTAMP_MICROS(time_usec) as Ptime, email, event_name, drive.doc_title, drive.doc_type, drive.shared_drive_id
     FROM `project.Device_Admin_Data.activity`
     WHERE event_name = "create" AND drive.doc_type = "shared_drive"  
    order by Ptime

In our case, out of over 1200 shared drives, I got only 746 creators. 
If you're setting up to gather Admin logs for the first time, then theoretically they only go back around 6 months (it's a bit grey, you may get quite a few older), so you may not be able to find the creator of a shared drive that is older than 6 months.

It does seem to be an interesting omission that you can't say who actually created the shared drive for the whole lifetime of the drive, unless you obsessively collect the Admin logs.
Temple

Sandip Admin

unread,
Sep 13, 2023, 2:02:53 AM9/13/23
to GAM for Google Workspace
Hi Ross & Temple,

Thank you for your help.

Well let you know if I face any difficulties regarding the same.

Thanks and Regards,

Reply all
Reply to author
Forward
0 new messages