Remove Deleted Google Accounts as Editors or Viewers to Drive Files

When you delete a Google accounts from your domain you are left for a period with a numbered account. These numbered accounts are still showing as owners, editors or viewers of files. Sometimes it is useful to clear them out en-masse.

When the account is deleted we continue to show the account as a number, because it can frequently be an aide to help people find Google docs that deleted users had access to or ownership of (at least in the moments of panic that sometimes follows the deletion of a G Suite account and other users realize that the documents they were working on belonged to someone else).

To find all of these ‘numbered’ users in one search at your domain use the following regular expression

[0-9]{10,20}

Note: Users deleted from your Google domain appear to have no domain extension, so are just numbered accounts.

To find all of these ‘numbered’ users in one search from an external domain use the following regular expression

([0-9]+(\@(?i)(other-domain\.com))$)

Replace ‘other-domain’ with the first part of the other domain name and be sure to tick the Reg Exp. box, also change the TLD (top level domain) as appropriate.

This will find these deleted accounts in any position, owner, editor, and viewer.

You can refine the search by looking for the numbered accounts in any one position.

To find all of these ‘numbered’ users in one search from any external domain use the following regular expression

[0-9]{10,20}[@][a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{0,8})

Let’s say you find all the accounts with a numbered owner as ‘editor’. Because GAT now views these as external accounts you can remove them as editor to all Google docs in one collective clean-up.

Simply select ‘Schedule/Save’, then select ‘Remove all external shares’, under ‘Custom Cron’, select ‘Just Once’.

For the first time, I advise checking the box on Don’t make changes, only report shares affected

This will give you a report of the files affected.

If you are happy with the report, run again with that box unchecked and all the deleted users will be removed from those files.

If you have purchased GAT ‘Unlock’ the extensive file management powers it offers are also available to you.

Here you can remove the numbered accounts as editors or viewers.

If and ONLY IF you have selected the numbered accounts in an ‘Owners’ search, you can change the ownership of files you have selected. (You do not want to change ownership to files where these were just editors or viewers.)

Tech Tip – Reports not cluttered with deleted account ownership.

If you want a ‘Clean’ report, but don’t want to remove these accounts as owners just yet, you can do a search for all numbered accounts where such accounts are owners. Then simply click ‘Negate Search’ and all the returned files will exclude the ones owned by these deleted users. Using ‘Recent Filters’ this can be further refined with other search criteria.

Matching any 11 numbered account against any domain

[0-9]{10,20}[@][a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{0,8})

Covers TLDs in size from .ie (2) to .business (8)

Numbered Accounts Only

[0-9]{10,20}

Relevent Resources:

Best Practice: How to Remove Permissions for ‘Docs Shared with Link’

Comments

comments