find the owner of a file/folder

989 views
Skip to first unread message

Alexander Kolodziej

unread,
Oct 31, 2016, 11:34:39 AM10/31/16
to GAM for G Suite
Hello!

Is there some way to figure out the owner of a file or folder by using the fileId of folderId?

  wbr / Alex

Ross Scroggs

unread,
Oct 31, 2016, 12:22:54 PM10/31/16
to google-ap...@googlegroups.com
Alexander,

gam user <User> show fileinfo <FileID>


Ross


--
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/b6f67bd4-5948-4d90-858e-c6fe5cd18869%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alexander Kolodziej

unread,
Oct 31, 2016, 12:59:58 PM10/31/16
to GAM for G Suite
Hello Ross!

First, thanks for the "change ownership recursively" addition in GAMADV-X! :)

Two issues with your suggestion though:
1. it seems i already have to know the owner to be able to find out the owner? :)
2. does not work for folders (?)

  wbr / Alex


Den måndag 31 oktober 2016 kl. 17:22:54 UTC+1 skrev Ross Scroggs:
Alexander,

gam user <User> show fileinfo <FileID>


Ross

On Mon, Oct 31, 2016 at 8:20 AM, Alexander Kolodziej <alexander...@tactel.se> wrote:
Hello!

Is there some way to figure out the owner of a file or folder by using the fileId of folderId?

  wbr / Alex

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



--

Graham Ingleby

unread,
Oct 31, 2016, 1:01:10 PM10/31/16
to GAM group
If you do this for a user who has access to the file then you can get the owner - do you have someone with access in order to get the fileid?


 

 Graham Ingleby | Google Cloud Consultant | +44 1344 203395 | ging...@ancoris.com

Google+      

Powered by Ancoris Signatures


On 31 October 2016 at 16:59, Alexander Kolodziej <alexander...@tactel.se> wrote:
Hello Ross!

First, thanks for the "change ownership recursively" addition in GAMADV-X! :)

Two issues with your suggestion though:
1. it seems i already have to know the owner to be able to find out the owner? :)
2. does not work for folders (?)

  wbr / Alex


Den måndag 31 oktober 2016 kl. 17:22:54 UTC+1 skrev Ross Scroggs:
Alexander,

gam user <User> show fileinfo <FileID>


Ross

On Mon, Oct 31, 2016 at 8:20 AM, Alexander Kolodziej <alexander...@tactel.se> wrote:
Hello!

Is there some way to figure out the owner of a file or folder by using the fileId of folderId?

  wbr / Alex

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



--

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



This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




Alexander Kolodziej

unread,
Oct 31, 2016, 1:05:34 PM10/31/16
to GAM for G Suite
Ah, no.
The gam instance will use a master (nonpersonal) user that likely does not have the file/folder shared with him/her/it.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.



--

--
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,
Oct 31, 2016, 1:19:51 PM10/31/16
to google-ap...@googlegroups.com
Alexander,

$ gam user testuser1 show fileinfo drivefilename 'Classroom' id title owners mimetype

Getting all Drive Files/Folders that match query ('me' in owners and title = 'Classroom') for test...@rdschool.org (1/1)

Got 0 Drive Files/Folders for test...@rdschool.org...

User: test...@rdschool.org, Show 0 Drive Files/Folders (1/1)


$ gam user testuser1 show fileinfo anydrivefilename 'Classroom' id title owners mimetype

Getting all Drive Files/Folders that match query (title = 'Classroom') for test...@rdschool.org (1/1)

Got 1 Drive File/Folder for test...@rdschool.org...

User: test...@rdschool.org, Show 1 Drive File/Folder (1/1)

  Drive Folder: Classroom (<FileID>) (1/1)

    id: <FileID>

    mimeType: application/vnd.google-apps.folder

    owners:

      displayName: Tést User2

        emailAddress: test...@rdschool.org

        isAuthenticatedUser: False

        permissionId: 17868704419089105705

        picture:

          url: https://lh5.googleusercontent.com/-KpzR40P-E88/AAAAAAAAAAI/AAAAAAAAAAA/Z4xhYgEQCHM/s64/photo.jpg

    title: Classroom


The anydrivefilename argument drops the 'me' in owners part of the query but testuser1 must still have some access to the file to be able to see it.


Ross


Ah, no.
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 "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.


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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



--

Alexander Kolodziej

unread,
Oct 31, 2016, 1:44:47 PM10/31/16
to GAM for G Suite
Ah, so i will need to have some access anyway.

The thing is that i am trying to automatize that users should be able to transfer ownership of (a subset of) their files to a "master" user (using "claim ownership").
They will be able to do this through a portal of sorts, where they are authenticated via LDAP (and then i will know their email, and hence their G Suite Account. A webpage that is.

But of course i dont want people to be able to transfer ownership of files that they do not own.

So my question is actually mostly about folders, not files (since "claim ownership" takes a folderId as argument).

I guess that i could run a check similar to that above, and if i get no output, or just an error, than i know for sure that the user is not the owner.

But i still need to be able to do this check for folders, not just files.

Any suggestions? :)

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



--

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


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




--
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,
Oct 31, 2016, 1:53:08 PM10/31/16
to google-ap...@googlegroups.com
Alexander,

drivefilename does not imply files only, the name can be that of a folder as in the example.

Ross

Ah, no.
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 "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.


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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



--

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



--

Alexander Kolodziej

unread,
Oct 31, 2016, 2:15:45 PM10/31/16
to GAM for G Suite
Aah, i did not look close enough there, thanks!
This will work fine for me, thanks again for developing this script! :)
Ah, no.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.



--

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


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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



--

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



--
Reply all
Reply to author
Forward
0 new messages