How to use GAM to delete MP4 files from all users Google Drives

236 views
Skip to first unread message

NWL Admin

unread,
Sep 9, 2022, 6:02:26 AM9/9/22
to GAM for Google Workspace
HI - anyone help here? Lots of students are storing inappropriate videos in their Google Drive, or stuff shared with them.

Is there a way to delete ALL MP4 using GAM across all 800 users. Also, can't seem to find a way to block the saving of MP4's in their Google Drive either?

All help appreciated please 👍

NEWMAN, P

unread,
Sep 9, 2022, 9:39:44 AM9/9/22
to google-ap...@googlegroups.com
Hi,
Have a look at https://sites.google.com/jis.edu.bn/gam-commands/services/drive#h.p_BU0r67k97uvl 

Delete all Videos
gam ou /Path/To/OU print filelist id mimetype name query "mimeType contains 'video/'" > VideoFiles.csv

Inspect and check VideoFiles.csv

gam csv VideoFiles.csv gam user ~Owner delete drivefile ~id purge

I don't know any way to stop them uploading videos, you could restrict the storage space down for repeat offenders, but I'm inclined to suggest it's not an IT problem as such more a 'classroom discipline' problem and should be dealt with by the safeguarding/senior leadership teams or whoever deals with behavior problems.

HTH

Piers


--
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/b2afd276-bffb-495d-afbd-cf826b576646n%40googlegroups.com.


--

Piers Newman

Network Technician

 

NWL Admin

unread,
Sep 12, 2022, 4:47:32 AM9/12/22
to google-ap...@googlegroups.com
Thanks Piers - really appreciate it.

Can I check - using  /Path/To/OU will mean that I can delete them for a specific OU, e.g Pupils and not teachers?

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/Ezb3EUutbGs/unsubscribe.
To unsubscribe from this group and all its topics, 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/CABzAEG%3Dd1%3DtyRnQoQQY3F5Vd341DrMnzEuNkxrujrw8nPQpZOQ%40mail.gmail.com.

NEWMAN, P

unread,
Sep 12, 2022, 5:46:11 AM9/12/22
to google-ap...@googlegroups.com
Yes, that would work. I think definitely need to report to the safeguarding team (if they are not already aware)

James SEYMOUR

unread,
Sep 21, 2022, 2:56:22 AM9/21/22
to google-ap...@googlegroups.com
Hi Piers,

Just to confirm ou /Path/To/OU will look at all the users in that OU only. You can use ou_and_children /Top/Level/OU to look at all the users in the top level OU and any sub OUs.

Regards


James Seymour
Head of Systems and Communication
[t] +673.24.11.000  Ext 1203
[Time Zone] GMT +8 Hours


  I'm using Inbox When Ready to protect my focus.


Jerudong International School
https://www.jerudonginternationalschool.com
Follow us on:
http://www.facebook.com/jisbruneidarussalam http://www.twitter.com/jisbrunei http://www.instagram.com/jisbrunei https://www.youtube.com/user/JISBrunei https://www.flickr.com/photos/133960569@N03/albums

NWL Admin

unread,
Sep 21, 2022, 3:13:47 AM9/21/22
to google-ap...@googlegroups.com

NWL Admin

unread,
Sep 21, 2022, 3:17:05 AM9/21/22
to google-ap...@googlegroups.com
Can I check - this seems to chuck up a 400 ID error.

Is it because there are spaces in the OUs?

gam ou_and_children /Hasmonean High School for Boys/Student print filelist id mimetype name query "mimeType contains 'video/'" > VideoFiles.csv

On Wed, 21 Sept 2022 at 07:56, 'James SEYMOUR' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:

NEWMAN, P

unread,
Sep 21, 2022, 3:46:25 AM9/21/22
to google-ap...@googlegroups.com
It is,
you will need to do
'/Hasmonean High School for Boys/Student'
with enclosing ' marks.
We have spaces in our OU structure as well so to make it easier for us we set up a google doc with the ones we commonly use ready to copy and paste.
HTH
Piers

NWL Admin

unread,
Oct 31, 2022, 1:28:32 PM10/31/22
to GAM for Google Workspace
Hi Piers,

Thanks for all help so far. I still seem to get the same error, Invalid Input: INVALID_OU_ID

Seems to be looking for (orgUnitPath='/\'/Hasmonean') ... not sure where the '/\' is coming from?

Gabriel Clifton

unread,
Oct 31, 2022, 1:49:49 PM10/31/22
to google-ap...@googlegroups.com
I do this as a two parter just to ensure there are no valid files. IE our band students record themselves to help them learn their mistakes.

gam ou_and_children "/HS/High School Students" print filelist id mimetype name query "mimeType contains 'video/'">HSVideoFiles.csv
gam csv HSVideoFiles.csv gam user ~Owner delete drivefile ~id purge





--

Gabriel Clifton | Network Administrator

Fort Stockton ISD | Technology Center

gabriel...@fsisd.net | http://www.fsisd.net

Office (432) 336-4055 Ext 2

Fax (432) 336-4050

1204 W. Second St., Fort Stockton, TX 79735


Please note: Although we sometimes respond to email, text, and phone calls instantly at all hours, our regular support hours are 8:00 AM - 5:00 PM, Monday through Friday.

We may need to wait until the next school day to address your issue. All issues are taken care of on a first-come, first-served basis, depending on severity, and problems with proper work orders submitted are handled first.


Confidentiality notice: The contents of this email message and any attachments are intended solely for the addressee(s), may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

Ross Scroggs

unread,
Oct 31, 2022, 1:58:54 PM10/31/22
to google-ap...@googlegroups.com
Show the complete command.

Ross



--

Ross Scroggs

unread,
Nov 1, 2022, 10:26:39 AM11/1/22
to google-ap...@googlegroups.com
Use ", not '

gam ou_and_children "/Hasmonean High School for Boys/Student" print filelist id mimetype name query "mimeType contains 'video/'" > VideoFiles.csv

Ross

On Mon, Oct 31, 2022 at 10:28 AM NWL Admin <n...@hasmoneanmat.org.uk> wrote:


--
Reply all
Reply to author
Forward
0 new messages