I am trying to eliminate sensitive documents being visible in Google Drive when a random employee searches with source:domain as the parameter. My preference is that no documents show up in source:domain. Unfortunately, due to bad G Suite settings, we have many legacy documents that I need to update such that they are not visible in G Suite's Drive search.
Here is what I've started to do. I run this command to get all the documents that are visible via search:
gam all users show filelist query "visibility='domainCanFind'" todrive
This generates a Google Sheet that has all the users/document pairs that are visible. It's some 60,000 documents.
I then ran this command on a few entries: gam user <specific user email> show drivefileacl <specific long id for a file> and I see all the permissions. I key in on the one that looks like this (because of the allowFileDiscovery setting):
<long number>
displayName: <company name>
allowFileDiscovery: True
role: reader
type: domain
id: <another more important number>
I see that <another more important number> is the same regardless of what doc/user pair I look at.
So, then I created new columns in my sheet so that for every user/document pair, I have a line like this:
user <user email address> delete drivefileacl <unique file id as show in the URL for the doc> id:<another more important number...the one mentioned above>
Finally, I copy the line above (generated via Google Sheets formula) into a .bat file and I run it. I do about 1,000 at at time because it takes a while to run.
I've done about 3,000 so far of my 60,000+ and just want to confirm that this is the only way to do this and the best way to do this for somebody who doesn't want to run a Python program.
Is there a simpler command?
Are there any unintended consequences to this?
Also, just to be sure, this is not changing people's access to the document if it has been properly shared with them, right? I'm just removing domainwide visibility of docs that are accessible via a shared link, right?
Thanks.
for the search engines if anybody else is having this issue: documents shared with entire company, Google drive searchable, can see documents they shouldn't, allowFileDiscovery, People at <your domain> can find and access, G Suite, Drive, Google Docs, prevent doc from being searchable, prevent documents, stop documents, avoid documents, revoke, sensitive documents, secure, unsecure, exposed, fix