Remove externally owned folder from User's MyDrive

12 views
Skip to first unread message

Eric Yu

unread,
Jan 20, 2026, 2:49:00 PM (15 hours ago) Jan 20
to GAM for Google Workspace
Hi everyone,

Has anyone figured out a command for removing an externally owned folder from a MyDrive folder? 

In the Google GUI it's right-click remove.

I've attempted to use delete drivefile and deletedrivefileacl but I keep getting hit with no permissions. 

For context: I'm attempting to migrate a user's files to GSD but since there are externally owned items, I've been making copies of the folders and removing the original. Once all externally owned items are cleared, I use the Google GUI to migrate the files in one shot. 

Eric

Ross Scroggs

unread,
Jan 20, 2026, 3:08:59 PM (15 hours ago) Jan 20
to google-ap...@googlegroups.com
The is no Drive API support for this, thus GAM can't help.

Ross
----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/521493bd-e7f2-40af-9db7-da9618d93857n%40googlegroups.com.

Eric Yu

unread,
Jan 20, 2026, 4:11:57 PM (14 hours ago) Jan 20
to GAM for Google Workspace
Hey Ross!

I may have come up with a workaround that you may be interested in. 

gam user [username] update drivefile [target document/folder ID] removeparents [target's parent ID]

This should remove the folder from the users mydrive. It does require knowing the ParentID of the item but it seems to work.

Thanks for all your work on GAM!

Eric

Ross Scroggs

unread,
Jan 20, 2026, 4:28:58 PM (13 hours ago) Jan 20
to google-ap...@googlegroups.com
Now do: gam user [username] show fileinfo [target document/folder ID] filepath

What do you see for Path in the output?

Ross

----
Ross Scroggs



Eric Yu

unread,
Jan 20, 2026, 4:35:01 PM (13 hours ago) Jan 20
to GAM for Google Workspace
Hmm, I'm getting:

Show Failed: Does not exist

Wouldn't removal of all parents bring the item back to the external user's orphaned files? At which point I wouldn't have visibility or control over them.

Eric

Jay Lee

unread,
Jan 20, 2026, 4:39:16 PM (13 hours ago) Jan 20
to google-ap...@googlegroups.com
A folder owned by someone else can't be in your My Drive, only a shortcut to the folder can:

https://developers.google.com/workspace/drive/api/guides/shortcuts

It sounds like you removed the shortcut.

Jay Lee


Reply all
Reply to author
Forward
0 new messages