Bulk Permission change in Google Drive

399 views
Skip to first unread message

Andrius Aguinaldo

unread,
Mar 15, 2021, 3:29:52 PM3/15/21
to GAM for Google Workspace
Hi, we were using Promevo and we accidentally transferred the ownership of the entire drive to an enduser. We revert it back to the correct owner but it carried over the "enduser" as an editor to all the folders and files. Is there an API or GAM bulk command that can "crawl" on all the folders and files and remove that "enduser" as an editor? 

Brian Kim

unread,
Mar 15, 2021, 3:42:21 PM3/15/21
to GAM for Google Workspace

Andrius Aguinaldo

unread,
Mar 16, 2021, 8:24:48 PM3/16/21
to GAM for Google Workspace
Hi Im getting this error when running the script. 
Traceback (most recent call last):
 File "/Users/ckubota/Desktop/GetSharedWithUserDriveACLs.py", line 58, in <module>
  for row in csv.DictReader(inputFile, quotechar=QUOTE_CHAR):
 File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/csv.py", line 111, in __next__
  row = next(self.reader)
_csv.Error: line contains NUL

In the script itsself it mentions QUOTE_CHAR = '"' # Adjust as needed
What does this mean and what would the normal adjustment be here?

Brian Kim

unread,
Mar 17, 2021, 6:56:46 AM3/17/21
to GAM for Google Workspace
Quote char needs adjustments if you made any changes to gam print commands.

What does your filelistperms.csv look like? 
Looks like you are running this on Windows. Did you make changes to line terminator?

Andrius Aguinaldo

unread,
Apr 1, 2021, 1:13:04 AM4/1/21
to GAM for Google Workspace
Bryan! You are the best! Thanks man! That really helps!

The next challenge I have is, when we accidentally transferred the ownership of the entire drive to an end user: Here's the story again "Hi, we were using Promevo and we accidentally transferred the ownership of the entire drive to an enduser. We revert it back to the correct owner but it carried over the "enduser" as an editor to all the folders and files." 
It moved some of the subfolders and files to main root folder. Users now have shortcut links since some folders/files has been moved. Is there a GAM command to revert it back to where they used to be? 

Kim Nilsson

unread,
Apr 1, 2021, 5:56:53 AM4/1/21
to GAM for Google Workspace
Only if you had a perfect record of where everything was before hand.

Andrius Aguinaldo

unread,
Apr 1, 2021, 1:12:34 PM4/1/21
to google-ap...@googlegroups.com
Hi Kim, 
When you say perfect, you mean nothing has been added/removed after the move? 
And if we do have a perfect record where everything was, is there a GAM command to put everything back to where it was? 

On Thu, Apr 1, 2021 at 5:56 AM Kim Nilsson <there.is.no...@gmail.com> wrote:
Only if you had a perfect record of where everything was before hand.

--
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/3f7296cc-1d88-42ed-a015-b6eff4258d92n%40googlegroups.com.


--
Andrius Aguinaldo
I.T. Support Specialist

Kim Nilsson

unread,
Apr 2, 2021, 3:37:14 AM4/2/21
to Google Apps Manager
Yes, if you have user, fileid, and file path of original position, then you can use that to reposition the files/folders. 

Andrius Aguinaldo

unread,
Apr 2, 2021, 3:49:28 AM4/2/21
to google-ap...@googlegroups.com
If we have about 500K worth of files and folders, how can we do a "bulk"? Any template GAM script you can suggest? 

Thank you so much!

On Fri, Apr 2, 2021 at 3:37 AM Kim Nilsson <there.is.no...@gmail.com> wrote:
Yes, if you have user, fileid, and file path of original position, then you can use that to reposition the files/folders. 

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

Kim Nilsson

unread,
Apr 2, 2021, 4:41:11 AM4/2/21
to GAM for Google Workspace
gam can read that csv file as input for action commands.

Reply all
Reply to author
Forward
0 new messages