is there are parameter for number of files owned by the user?

319 views
Skip to first unread message

A J Uddin

unread,
Mar 12, 2018, 11:03:17 AM3/12/18
to GAM for G Suite
I am trying to get a report for all user with the number of files owned by them, any recommendation please? 

Thanks in advance.

AJ

Ross Scroggs

unread,
Mar 12, 2018, 11:18:44 AM3/12/18
to google-ap...@googlegroups.com
A J

gam user us...@domain.com print filelist id > userfiles.csv

Linux/MacOS: wc -l userfiles.csv
Windows: find /v /c "" userfiles.csv

Subtract one from the count to account for the header row.

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/6170088e-afef-46b1-805f-bea2f7e3ea8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

A J Uddin

unread,
Mar 12, 2018, 11:37:58 AM3/12/18
to GAM for G Suite
Thanks Ross, 

I looked in to that one, it becomes rather a very big file as I have 5K + accounts. I am looking for integer value rather then all details of every single file.
Looked here, Can't seem to get the one for total number of files owned by the user!! 

Much appreciated.

AJ 


On Monday, 12 March 2018 15:18:44 UTC, Ross Scroggs wrote:
A J

gam user us...@domain.com print filelist id > userfiles.csv

Linux/MacOS: wc -l userfiles.csv
Windows: find /v /c "" userfiles.csv

Subtract one from the count to account for the header row.

Ross
On Mon, Mar 12, 2018 at 8:03 AM, A J Uddin <aju...@gmail.com> wrote:
I am trying to get a report for all user with the number of files owned by them, any recommendation please? 

Thanks in advance.

AJ

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



--

Ross Scroggs

unread,
Mar 12, 2018, 3:22:57 PM3/12/18
to google-ap...@googlegroups.com
A J,

I think that there used to be a variable in the Reports API with the counts but they got dropped.

Maybe someone else has a suggestion.

I could add a countspnly option to print filelist that would output a row with counts for each MIME type.

Ross

On Mon, Mar 12, 2018 at 8:37 AM, A J Uddin <aju...@gmail.com> wrote:
Thanks Ross, 

I looked in to that one, it becomes rather a very big file as I have 5K + accounts. I am looking for integer value rather then all details of every single file.
Looked here, Can't seem to get the one for total number of files owned by the user!! 

Much appreciated.

AJ 

On Monday, 12 March 2018 15:18:44 UTC, Ross Scroggs wrote:
A J

gam user us...@domain.com print filelist id > userfiles.csv

Linux/MacOS: wc -l userfiles.csv
Windows: find /v /c "" userfiles.csv

Subtract one from the count to account for the header row.

Ross
On Mon, Mar 12, 2018 at 8:03 AM, A J Uddin <aju...@gmail.com> wrote:
I am trying to get a report for all user with the number of files owned by them, any recommendation please? 

Thanks in advance.

AJ

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



--

Ross Scroggs

unread,
Mar 13, 2018, 12:25:08 AM3/13/18
to google-ap...@googlegroups.com
A J,

I've updated https://github.com/taers232c/GAMADV-X and https://github.com/taers232c/GAMADV-XTD with commands to count files.

<DriveFileQueryShortcut> ::=
        all_files | all_folders | all_google_files | all_non_google_files | all_items |
        my_files | my_folders | my_google_files | my_non_google_files | my_items |
        others_files | others_folders | others_google_files | others_non_google_files | others_items |
        writable_files

<MimeTypeShortcut> ::=
        gdoc|gdocument|
        gdrawing|
        gfolder|gdirectory|
        gform|
        gfusion|
        gmap|
        gpresentation|
        gscript|
        gsite|
        gsheet|gspreadsheet

gam <UserTypeEntity> show filecounts [anyowner|(showownedby any|me|others)]
        [query <QueryDriveFile>] [fullquery <QueryDriveFile>] [<DriveFileQueryShortcut>] [showmimetype [not] <MimeTypeList>]
gam <UserTypeEntity> print filecounts [todrive [<ToDriveAttributes>]] [anyowner|(showownedby any|me|others)]
        [query <QueryDriveFile>] [fullquery <QueryDriveFile>] [<DriveFileQueryShortcut>] [showmimetype [not] <MimeTypeList>]

$ gam user testuser1 show filecounts
Getting all Drive Files/Folders that match query ('me' in owners) for test...@rdschool.org
Got 131 Drive Files/Folders for test...@rdschool.org...
  User: test...@rdschool.org, Drive Files/Folders: 131
    application/msword: 2
    application/octet-stream: 6
    application/pdf: 2
    application/vnd.google-apps.document: 31
    application/vnd.google-apps.drawing: 1
    application/vnd.google-apps.drive-sdk.758379822725: 1
    application/vnd.google-apps.folder: 42
    application/vnd.google-apps.form: 2
    application/vnd.google-apps.map: 1
    application/vnd.google-apps.presentation: 1
    application/vnd.google-apps.script: 2
    application/vnd.google-apps.spreadsheet: 18
    application/vnd.ms-excel: 2
    application/vnd.ms-powerpoint: 2
    application/vnd.oasis.opendocument.presentation: 1
    application/vnd.oasis.opendocument.spreadsheet: 1
    application/vnd.oasis.opendocument.text: 1
    application/vnd.openxmlformats-officedocument.presentationml.presentation: 1
    application/vnd.openxmlformats-officedocument.presentationml.template: 1
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: 3
    application/vnd.openxmlformats-officedocument.spreadsheetml.template: 1
    application/vnd.openxmlformats-officedocument.wordprocessingml.document: 2
    application/vnd.openxmlformats-officedocument.wordprocessingml.template: 1
    application/x-gzip: 1
    audio/x-wav: 1
    image/jpeg: 1
    message/rfc822: 1
    text/csv: 1
    text/plain: 1

$ gam user testuser1 print filecounts
Getting all Drive Files/Folders that match query ('me' in owners) for test...@rdschool.org
Got 131 Drive Files/Folders for test...@rdschool.org...
User,Total,application/msword,application/octet-stream,application/pdf,application/vnd.google-apps.document,application/vnd.google-apps.drawing,application/vnd.google-apps.drive-sdk.758379822725,application/vnd.google-apps.folder,application/vnd.google-apps.form,application/vnd.google-apps.map,application/vnd.google-apps.presentation,application/vnd.google-apps.script,application/vnd.google-apps.spreadsheet,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/x-gzip,audio/x-wav,image/jpeg,message/rfc822,text/csv,text/plain
test...@rdschool.org,131,2,6,2,31,1,1,42,2,1,1,2,18,2,2,1,1,1,1,1,3,1,2,1,1,1,1,1,1,1

$ gam user testuser1 show filecounts my_google_files
Getting all Drive Files/Folders that match query ('me' in owners and mimeType != 'application/vnd.google-apps.folder' and mimeType contains 'vnd.google') for test...@rdschool.org
Got 57 Drive Files/Folders for test...@rdschool.org...
  User: test...@rdschool.org, Drive Files/Folders: 57
    application/vnd.google-apps.document: 31
    application/vnd.google-apps.drawing: 1
    application/vnd.google-apps.drive-sdk.758379822725: 1
    application/vnd.google-apps.form: 2
    application/vnd.google-apps.map: 1
    application/vnd.google-apps.presentation: 1
    application/vnd.google-apps.script: 2
    application/vnd.google-apps.spreadsheet: 18

$ gam user testuser1 show filecounts query "mimeType contains 'ms'"
Getting all Drive Files/Folders that match query ('me' in owners and mimeType contains 'ms') for test...@rdschool.org
Got 6 Drive Files/Folders for test...@rdschool.org...
  User: test...@rdschool.org, Drive Files/Folders: 6
    application/msword: 2
    application/vnd.ms-excel: 2
    application/vnd.ms-powerpoint: 2

$ gam user testuser1 show filecounts showownedby others
Getting all Drive Files/Folders that match query (not 'me' in owners) for test...@rdschool.org
Got 18 Drive Files/Folders for test...@rdschool.org...
  User: test...@rdschool.org, Drive Files/Folders: 18
    application/pdf: 2
    application/vnd.google-apps.document: 9
    application/vnd.google-apps.folder: 4
    application/vnd.google-apps.presentation: 1
    application/vnd.google-apps.site: 1
    application/vnd.google-apps.spreadsheet: 1


Ross

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@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.

A J Uddin

unread,
Mar 13, 2018, 7:32:04 AM3/13/18
to google-ap...@googlegroups.com
Hi Ross,

Thats brilliant 

Only problem in exception handling, its stopping when it finds an account that has not got drive turned on. is there a workaround for this?

Regards 

AJ

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.

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

Ross Scroggs

unread,
Mar 13, 2018, 7:53:50 AM3/13/18
to google-ap...@googlegroups.com
A J,

It's a bug, will be fixed shortly.

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@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,
Mar 13, 2018, 9:06:01 AM3/13/18
to google-ap...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@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.

A J Uddin

unread,
Mar 15, 2018, 9:40:37 AM3/15/18
to google-ap...@googlegroups.com
Hi Ross,

Thanks again, I have tried 55.43 it would still stop at account with no drive enabled.

Regards 

AJ


--
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/r4INzxXcb9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsubscribe...@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.

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

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

Steve - DynTech

unread,
Jul 20, 2018, 5:05:24 AM7/20/18
to GAM for G Suite
Is there a way to get an aggregate count for all users in the domain, not per user?
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.

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

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

+KimNilsson

unread,
Jul 23, 2018, 11:59:04 AM7/23/18
to GAM for G Suite
@Steve , you can do it with GAT, but I don't know if that's an internal aggregation, or if they just know how to ask the API.
Reply all
Reply to author
Forward
0 new messages