Get list of files in a drive folder owned by a deleted user

729 views
Skip to first unread message

Kevin Woody

unread,
Aug 7, 2024, 2:29:46 PM8/7/24
to GAM for Google Workspace
One of our other super admins deleted a user 21 days ago. Some of our teachers actively worked out of a folder owned by the deleted user. They can still access files that were stored in that folder (files owned by active users, not the deleted user) if they search for them individually. I'm trying to get a list of all files from that folder so I can bulk move them all to a folder owned by an active teacher.

I've read through other threads and found the command:

gam user u...@domain.com print filelist select <PutFolderIdHere> fields id,name,mimetype

However, this relies on u...@domain.com being an active account. Since the account is deleted, the resulting spreadsheet doesn't list anything.

Kevin Woody

unread,
Aug 7, 2024, 2:46:31 PM8/7/24
to GAM for Google Workspace
My next idea that I'm trying to figure out now, instead, is to focus on the users who had files in that folder. I'd like to get a list of all files owned by them, including the name or ID of the folder that every file is stored in. Then from the resulting csv I can identify which files are located in that folder and move them out. I just started searching to see if I can find the command to do this, but any help would be appreciated.

✉ Kevin Melillo

unread,
Aug 7, 2024, 2:55:37 PM8/7/24
to google-ap...@googlegroups.com
You should be able to restore the user from the Admin Panel.  Go to Directory>Users, on the right choose more options, recently deleted users... restore the user, then the documents should be restored as well.

--
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/4ec48c3d-1716-487a-9d85-90a26c04c9fdn%40googlegroups.com.

Kevin Woody

unread,
Aug 7, 2024, 3:06:21 PM8/7/24
to GAM for Google Workspace
The users was deleted more than 20 days ago and cannot be restored

Ross Scroggs

unread,
Aug 7, 2024, 5:40:49 PM8/7/24
to google-ap...@googlegroups.com
Kevin,

Send me a Meet/Zoom invitation and I'll try to help.

Ross



--

Ian Crew

unread,
Aug 7, 2024, 5:51:27 PM8/7/24
to google-ap...@googlegroups.com
This sounds like you're talking about what's commonly referred to as the "Orphaned Files" issue in Drive. See https://support.google.com/drive/thread/236647252/what-is-an-orphaned-file?hl=en  for more.

Once a file loses its parent folder, the only recourse is to manually recreate the folders and re-organize the orphaned files into those new folders. It's a major pain, and probably the single biggest reason why any files/folders that need to stick around beyond the time of any one person in the organization should really be in Shared Drives, not My Drive....

Sorry to be the bearer of bad news,

Ian

--
Ian Crew

Architect, Communication and Collaboration Services
Productivity & Collaboration Services
Berkeley IT
University of California, Berkeley


Kevin Woody

unread,
Aug 7, 2024, 6:10:23 PM8/7/24
to GAM for Google Workspace
Thanks Ross & Ian,

I think I have it figured out. Ian, you found the same thing I did, orphaned files. So what I'm doing is collecting the orphan files for each of the teachers who were part of that grade level team over the past few years, putting those all into a single location, and then the current teachers will just have to sort through it all. 

I've been building a plan to move the entire school to Shared Drives and this will be just another reason to convince everyone that we need to do this soon. I'm just happy those files were still recoverable and that only the oldest files would've been deleted. The deleted teacher hasn't worked here in maybe 10 years. I'm also working on building better policies for suspending and deleting accounts (been the IT manager here just one year so far).

✉ Kevin Melillo

unread,
Aug 8, 2024, 7:27:58 AM8/8/24
to google-ap...@googlegroups.com
When a user is deleted, in order to avoid MORE orphaned files, you can do a Drive Transfer.  This will at least ensure that the files and folder structure are not modified moving forward.

Although Shared Drives is another way to go.  Could be once the files are transferred to the 'NEW' owner, you can then do a move to Shared Drives.

Reply all
Reply to author
Forward
0 new messages