Identify File Owner with only the file ID

12,410 views
Skip to first unread message

David Carter Tod

unread,
Sep 30, 2016, 11:53:41 AM9/30/16
to Google Apps Manager
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

Ross Scroggs

unread,
Sep 30, 2016, 1:25:55 PM9/30/16
to google-ap...@googlegroups.com
David,


I don't see any way to search by ID.
It's look like you'd have to do: gam all users show fileinfo <FileID> owners
This is a valid command in standard gam but immediately fails if an user doesn't own the file.
This version will work as it handles the errors: https://github.com/taers232c/GAM/releases

Ross


On Fri, Sep 30, 2016 at 8:53 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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/b1cc42a4-37b1-404c-a764-aec3e1a38862%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

David Carter Tod

unread,
Sep 30, 2016, 1:32:03 PM9/30/16
to Google Apps Manager
Thanks, Ross. Unfortunately, we have well over a million users so I don't think that will be very practical.  Google support can see on their end, and they've put in an enhancement request to include this information, which is good news.


On Friday, September 30, 2016 at 1:25:55 PM UTC-4, Ross Scroggs wrote:
David,


I don't see any way to search by ID.
It's look like you'd have to do: gam all users show fileinfo <FileID> owners
This is a valid command in standard gam but immediately fails if an user doesn't own the file.
This version will work as it handles the errors: https://github.com/taers232c/GAM/releases

Ross

On Fri, Sep 30, 2016 at 8:53 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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-ap...@googlegroups.com.



--

Ross Scroggs

unread,
Sep 30, 2016, 2:40:28 PM9/30/16
to google-ap...@googlegroups.com
David,

"...we have well over a million users...", in other words "a small Google Apps site". Yikes!
Let us know if Google support comes up with something.

Ross

On Fri, Sep 30, 2016 at 10:32 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Thanks, Ross. Unfortunately, we have well over a million users so I don't think that will be very practical.  Google support can see on their end, and they've put in an enhancement request to include this information, which is good news.

On Friday, September 30, 2016 at 1:25:55 PM UTC-4, Ross Scroggs wrote:
David,


I don't see any way to search by ID.
It's look like you'd have to do: gam all users show fileinfo <FileID> owners
This is a valid command in standard gam but immediately fails if an user doesn't own the file.
This version will work as it handles the errors: https://github.com/taers232c/GAM/releases

Ross

On Fri, Sep 30, 2016 at 8:53 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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.

For more options, visit https://groups.google.com/d/optout.



--

Jared Mayer

unread,
Jan 29, 2017, 3:05:50 PM1/29/17
to GAM for G Suite

Hey Ross, 

I tried your command but getting an error:

Command: gam all users show fileinfo <insert FileID> owners
Output:
Getting all users in Google Apps account (may take some time on a large account)...
Got 10894 users...
done getting 6045 users.

ERROR: 401: Invalid Credentials - authError

Check serviceaccount passes on all tests. Running v4.02 of GAM. Any ideas? Does it mean the file is not owned by someone in my domain? 

Thanks
Jared

On Saturday, 1 October 2016 06:25:55 UTC+13, Ross Scroggs wrote:
David,


I don't see any way to search by ID.
It's look like you'd have to do: gam all users show fileinfo <FileID> owners
This is a valid command in standard gam but immediately fails if an user doesn't own the file.
This version will work as it handles the errors: https://github.com/taers232c/GAM/releases

Ross

On Fri, Sep 30, 2016 at 8:53 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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-ap...@googlegroups.com.



--

Ross Scroggs

unread,
Jan 29, 2017, 3:40:27 PM1/29/17
to google-ap...@googlegroups.com
Jared,

Show me: gam version

Ross

On Sun, Jan 29, 2017 at 12:05 PM, Jared Mayer <jared...@fronde.com> wrote:

Hey Ross, 

I tried your command but getting an error:

Command: gam all users show fileinfo <insert FileID> owners
Output:
Getting all users in Google Apps account (may take some time on a large account)...
Got 10894 users...
done getting 6045 users.

ERROR: 401: Invalid Credentials - authError

Check serviceaccount passes on all tests. Running v4.02 of GAM. Any ideas? Does it mean the file is not owned by someone in my domain? 

Thanks
Jared

On Saturday, 1 October 2016 06:25:55 UTC+13, Ross Scroggs wrote:
David,


I don't see any way to search by ID.
It's look like you'd have to do: gam all users show fileinfo <FileID> owners
This is a valid command in standard gam but immediately fails if an user doesn't own the file.
This version will work as it handles the errors: https://github.com/taers232c/GAM/releases

Ross

On Fri, Sep 30, 2016 at 8:53 AM, David Carter Tod <wcc...@email.vccs.edu> wrote:
Is there a way to user GAM to identify the owner of a file when only knowing the ID and without getting all users in a domain?

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, please respect that confidentiality and do not disclose, copy or make use of its contents. If received in error, please destroy this email and contact the sender immediately. Thank you.

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Jared Mayer

unread,
Jan 29, 2017, 4:13:26 PM1/29/17
to GAM for G Suite
Sorry, looks like 4.03. 

c:\GAM>gam version
Python 2.7.12 64-bit final
google-api-python-client 1.5.5
Windows-8.1-6.3.9600 AMD64
Path: c:\GAM
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.



--

The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, please respect that confidentiality and do not disclose, copy or make use of its contents. If received in error, please destroy this email and contact the sender immediately. Thank you.

--
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-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Jan 29, 2017, 4:27:40 PM1/29/17
to google-ap...@googlegroups.com
Jared,

Install it, copy client_secrets.json, oauth2.txt, oauth2service.json from their current folder to the new folder.
gam all users show fileinfo <insert FileID> permissions

Ross

Sorry, looks like 4.03. 

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, please respect that confidentiality and do not disclose, copy or make use of its contents. If received in error, please destroy this email and contact the sender immediately. Thank you.

--
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.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, please respect that confidentiality and do not disclose, copy or make use of its contents. If received in error, please destroy this email and contact the sender immediately. Thank you.

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Jan 29, 2017, 4:34:38 PM1/29/17
to google-ap...@googlegroups.com
Jared,

Here is a solution with the version you have:
gam print users primaryemail > users.csv
gam csv users.csv gam user "~primaryEmail"  show fileinfo <insert FileID> permissions

Ross

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.



--



--

Ross Scroggs

unread,
Jan 29, 2017, 4:41:58 PM1/29/17
to google-ap...@googlegroups.com
Jared,

Basic gam doesn't do much error handling, so this is the prototypical way to get the result you want.
gam print users primaryemail > users.csv (Or use some other list of users)
gam csv users.csv gam user "~primaryEmail"  <Some command>

gam runs a separate instance for each user "~primaryEmail" executing <Some command>, the users that trap on an error don't affect any of the other users.

Ross


--

Jared Mayer

unread,
Jan 29, 2017, 5:05:51 PM1/29/17
to google-ap...@googlegroups.com

​Thanks Ross for the assistance. I tried your GAM-B (thanks for updating) but got a missing file alert when executing commands. 

In the end, the CSV script against a user email address list gave me the owner, and I was able to update required permissions. Not as clean output tho. 

I will have to look at upgrading my GAM with the new releases. 

Side Question: I notice there are a number of GAM versions flying around as you all work together but also fork off each other.  Eg Jaylees, GAM-B, GAM-DVX, lerklompen version - now in GAM-DVX. 

Is there one true source for latest updates / best functionality?  

Cheers​

You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/h_juB52RA-4/unsubscribe.
To unsubscribe from this group and all its topics, 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.

For more options, visit https://groups.google.com/d/optout.

+KimNilsson

unread,
Jan 30, 2017, 3:12:12 AM1/30/17
to GAM for G Suite
If someone has touched the file within the last six months (edited, read, or changed it in any other way), the built in Drive Audit will tell you who is the owner, if you search for the FileID.
Reply all
Reply to author
Forward
0 new messages