Shared Drive - Remove Accounts

584 views
Skip to first unread message

Douglas Roske

unread,
Mar 18, 2022, 1:42:24 PM3/18/22
to GAM for Google Workspace
Hola to All -

I am looking for a way to remove all suspended users from any Shared Drive in a given domain. I thought about using a .csv with all the Shared Drive ids but I am not sure the removal calls would be recursive to all file/folders under any given drive. 

Anyone have a handy way to do this?

Thanks!

Doug

Gabriel Clifton

unread,
Mar 18, 2022, 1:44:14 PM3/18/22
to google-ap...@googlegroups.com
You know, I just came across this morning.
gam config auto_batch_min 1 redirect csv "%temp%\DisabledUserSharedDrives.csv" ou "/Inactive Users" print teamdrives roles commenter,reader,writer,fileorganizer
gam csv "%temp%\DisabledUserSharedDrives.csv" gam delete drivefileacl "~id" "~User"

--
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/5d4e9143-6691-4d8f-a962-d65264c4db0en%40googlegroups.com.


--

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 may sometimes respond to email, text, and phone calls instantly at all hours of the day, 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 attend to your issue. All issues are worked on a first-come, first-served basis depending on severity, and issues 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) and 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.
"You must always be willing to work without applause."
— Ernest Hemingway

"You just have to find that thing that's special about you that distinguishes you from all the others, and through true talent, hard work, and passion, anything can happen."
— Dr. Dre

Ross Scroggs

unread,
Mar 18, 2022, 1:50:32 PM3/18/22
to google-ap...@googlegroups.com

Alley Hood

unread,
Jun 2, 2022, 2:29:02 PM6/2/22
to GAM for Google Workspace
Gabriel - I ran this and got nothing.  What step am I missing?

Gabriel Clifton

unread,
Jun 2, 2022, 2:36:23 PM6/2/22
to GAM for Google Workspace
Alley, make sure you change ou "/Inactive Users" to whatever OU you have your disabled users in or use Ross' Python script.

Alley Hood

unread,
Jun 2, 2022, 2:39:10 PM6/2/22
to google-ap...@googlegroups.com
I think the issue is there is no csv to reference or does this create the file? 



On Thu, Jun 2, 2022 at 1:36 PM 'Gabriel Clifton' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
Warning: Replies to this message will go to google-apps-manager+bncBD3J...@googlegroups.com. If you are unsure this is correct please contact the helpdesk.

Unsubscribe

It appears that you have subscribed to commercial messages from this sender. To stop receiving such messages from this sender, please unsubscribe

Alley, make sure you change ou "/Inactive Users" to whatever OU you have your disabled users in or use Ross' Python script.

On Thursday, June 2, 2022 at 1:29:02 PM UTC-5 Alley Hood wrote:
Gabriel - I ran this and got nothing.  What step am I missing?

On Friday, March 18, 2022 at 12:44:14 PM UTC-5 Gabriel Clifton wrote:
You know, I just came across this morning.
gam config auto_batch_min 1 redirect csv "%temp%\DisabledUserSharedDrives.csv" ou "/Inactive Users" print teamdrives roles commenter,reader,writer,fileorganizer
gam csv "%temp%\DisabledUserSharedDrives.csv" gam delete drivefileacl "~id" "~User"

On Fri, Mar 18, 2022 at 12:42 PM Douglas Roske <dro...@chartertechnologiesllc.com> wrote:
Hola to All -

I am looking for a way to remove all suspended users from any Shared Drive in a given domain. I thought about using a .csv with all the Shared Drive ids but I am not sure the removal calls would be recursive to all file/folders under any given drive. 

Anyone have a handy way to do this?

Thanks!

Doug

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


--

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 may sometimes respond to email, text, and phone calls instantly at all hours of the day, 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 attend to your issue. All issues are worked on a first-come, first-served basis depending on severity, and issues 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) and 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.
"You must always be willing to work without applause."
— Ernest Hemingway

"You just have to find that thing that's special about you that distinguishes you from all the others, and through true talent, hard work, and passion, anything can happen."
— Dr. Dre


This is a staff email account managed by Mid-Del Public Schools.  This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender.

Gabriel Clifton

unread,
Jun 2, 2022, 2:42:38 PM6/2/22
to GAM for Google Workspace
redirect csv "%temp%\DisabledUserSharedDrives.csv" creates the CSV file in your Temp folder IF you are running this from a Windows command line. You would have to change the %temp% if you were using any other OS or program like PowerShell.

Alley Hood

unread,
Jun 2, 2022, 2:54:54 PM6/2/22
to GAM for Google Workspace
Weird - I run the command, and I see the progress and it says "Got O Shared Drives" for all of the users.  And no csv.  I will look at it more.  Thanks for any help.

Alley Hood

unread,
Jun 2, 2022, 5:24:23 PM6/2/22
to GAM for Google Workspace
Thank you for your help, Ross! 

Ross Scroggs

unread,
Jun 2, 2022, 5:28:43 PM6/2/22
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages