List files owned outside domain for a folder & sub folders?

462 views
Skip to first unread message

David Prior

unread,
Sep 7, 2022, 6:24:23 AM9/7/22
to GAM for Google Workspace
Hi,
Apologies if this is right in front of my nose ... . after a few searches I  saw some similar solutions but not exactly what I was looking for...
We're trying to move files to Shared Drives and repeatedly bump into the rules preventing moving files owned outside our domain.
Is there a way to find a list of those files starting at a particular folder and searching recursively?
Many thanks
dave

The contents of this e-mail and any attachments are confidential and only for use by the intended recipient. Any unauthorized use, distribution or copying of this message is strictly prohibited. If you are not the intended recipient, please inform the sender immediately by reply e-mail and delete this message from your system. Thank you for your cooperation.

Rance Hall

unread,
Sep 7, 2022, 9:05:37 AM9/7/22
to google-ap...@googlegroups.com

What you are finding is that files shared with your staff from another organization can’t be in “Shared Drives” because they were shared with a particular user and “Shared Drives”, by design, don’t limit permission scope the same way.

 

You have should address files in groups.

 

  1. Files owned by one of your users.
  2. Files owned by one of your users shared with another one of your users.
  3. Files owned by one of your users shared externally.
  4. Files owned by external users shared with one of your users.

 

 

Each of these cases are handled in slightly different but related ways.  If you can keep it straight which case you are working it will help you craft the right gam command.

 

Rance

 

 

 

-- 

 

Rance Hall

Application Specialist

ESU 10

rance...@esu10.org

308-698-1919

 

 


Some days are better, some days are worse.

Look for the blessing instead of the curse.

 

A picture containing text, sign, green

Description automatically generated

 

 

 

 

 

From: <google-ap...@googlegroups.com> on behalf of David Prior <david...@pistoiaalliance.org>
Reply-To: "google-ap...@googlegroups.com" <google-ap...@googlegroups.com>
Date: Wednesday, September 7, 2022 at 5:24 AM
To: GAM for Google Workspace <google-ap...@googlegroups.com>
Subject: [GAM] List files owned outside domain for a folder & sub folders?

 

[EXTERNAL EMAIL]

--
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/5c6d3556-19fd-49b3-b72c-e77224e7a679n%40googlegroups.com.

David Prior

unread,
Sep 7, 2022, 10:19:15 AM9/7/22
to GAM for Google Workspace
Thanks Rance,
Thinking about this in terms of groups is helpful. As far as I can tell only files in group 4 prevent the Admin move to Shared Drives. In our case they were actually originally shared with many people both internal and external via an external group access control.
We can "overcome" this by a crude copy/paste of each file or folder preserving the original owner and date in the file/folder title (not perfect I know but means searching is still possible). Ownership of the new file naturally reverts to within our domain. 
If GAM can distinguish files in category 4 then this will drastically cut down on the time required to search for and rename them manually before moving.
dave 

Rance Hall

unread,
Sep 7, 2022, 10:43:00 AM9/7/22
to google-ap...@googlegroups.com

GAM can’t distinguish between groups 3 & 4 directly, as far as I remember.  However; there is a way to analyze the ACLs to determine which files are in group 4 and then individually address them and get them out of the way and then group 3 becomes much easier.

 

R

 

-- 

 

Rance Hall

Application Specialist

ESU 10

rance...@esu10.org

308-698-1919

 

 


Some days are better, some days are worse.

Look for the blessing instead of the curse.

 

A picture containing text, sign, green

Description automatically generated

 

 

 

 

 

From: <google-ap...@googlegroups.com> on behalf of David Prior <david...@pistoiaalliance.org>
Reply-To: "google-ap...@googlegroups.com" <google-ap...@googlegroups.com>
Date: Wednesday, September 7, 2022 at 9:19 AM
To: GAM for Google Workspace <google-ap...@googlegroups.com>
Subject: Re: [GAM] List files owned outside domain for a folder & sub folders?

 

[EXTERNAL EMAIL]

Thanks Rance,

Thinking about this in terms of groups is helpful. As far as I can tell only files in group 4 prevent the Admin move to Shared Drives. In our case they were actually originally shared with many people both internal and external via an external group access control.

We can "overcome" this by a crude copy/paste of each file or folder preserving the original owner and date in the file/folder title (not perfect I know but means searching is still possible). Ownership of the new file naturally reverts to within our domain. 

If GAM can distinguish files in category 4 then this will drastically cut down on the time required to search for and rename them manually before moving.

dave 

On Wednesday, 7 September 2022 at 14:05:37 UTC+1 Rance Hall wrote:

What you are finding is that files shared with your staff from another organization can’t be in “Shared Drives” because they were shared with a particular user and “Shared Drives”, by design, don’t limit permission scope the same way.

 

You have should address files in groups.

 

  1. Files owned by one of your users.
  2. Files owned by one of your users shared with another one of your users.
  3. Files owned by one of your users shared externally.
  4. Files owned by external users shared with one of your users.

 

 

Each of these cases are handled in slightly different but related ways.  If you can keep it straight which case you are working it will help you craft the right gam command.

 

Rance

 

 

 

-- 

 

Rance Hall

Application Specialist

ESU 10

rance...@esu10.org

308-698-1919

 

 


Some days are better, some days are worse.

Look for the blessing instead of the curse.

 

Image removed by sender. A picture containing text, sign, green

Description automatically generated

 

 

 

 

 

From: <google-ap...@googlegroups.com> on behalf of David Prior <david...@pistoiaalliance.org>
Reply-To: "google-ap...@googlegroups.com" <google-ap...@googlegroups.com>
Date: Wednesday, September 7, 2022 at 5:24 AM
To: GAM for Google Workspace <google-ap...@googlegroups.com>
Subject: [GAM] List files owned outside domain for a folder & sub folders?

 

[EXTERNAL EMAIL]

Hi,

Apologies if this is right in front of my nose ... . after a few searches I  saw some similar solutions but not exactly what I was looking for...

We're trying to move files to Shared Drives and repeatedly bump into the rules preventing moving files owned outside our domain.

Is there a way to find a list of those files starting at a particular folder and searching recursively?

Many thanks

dave


The contents of this e-mail and any attachments are confidential and only for use by the intended recipient. Any unauthorized use, distribution or copying of this message is strictly prohibited. If you are not the intended recipient, please inform the sender immediately by reply e-mail and delete this message from your system. Thank you for your cooperation.

--
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/5c6d3556-19fd-49b3-b72c-e77224e7a679n%40googlegroups.com.


The contents of this e-mail and any attachments are confidential and only for use by the intended recipient. Any unauthorized use, distribution or copying of this message is strictly prohibited. If you are not the intended recipient, please inform the sender immediately by reply e-mail and delete this message from your system. Thank you for your cooperation.

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

Ross Scroggs

unread,
Sep 7, 2022, 12:08:12 PM9/7/22
to google-ap...@googlegroups.com
David,

This requires Advanced GAM. Replace domain.com in the command with your domain name and us...@domain.com with the desired user email address.

gam config csv_output_row_filter "owners.0.emailAddress:notregex:@domain.com$" csv_output_header_drop_filter "^owners$,^paths$" redirect csv ./ExternallyOwnedFiles.csv user us...@domain.com print filelist select <PutFolderIDHere> showownedby others fields id,name,owners.emailaddress filepath


Ross




--

David Prior

unread,
Sep 15, 2022, 7:11:12 AM9/15/22
to GAM for Google Workspace
Big thanks to you @Ross Scroggs - your knowledge and experience of this stuff is just awesome. Took a little while to get Advanced GAM going.  The Advanced GAM command you provided gave me exactly what I was looking for and after adjusting those files moving to Shared Drive was easy. 
We'll be using this again in the very near future!

Eric Hall

unread,
Feb 13, 2024, 10:10:20 AM2/13/24
to GAM for Google Workspace
I used: 

gam config csv_output_row_filter "owners.0.emailAddress:notregex:@ourdomain.org$" csv_output_header_drop_filter "^owners$,^paths$" redirect csv ./ExternallyOwnedFiles.csv user us...@ourdomain.org print all select <root folder ID> showownedby others fields id,name,owners.emailaddress filepath

I get this error:

ERROR: Invalid choice (select): Expected <users|users_ns|users_ns_susp|users_susp|cros>

Does anyone see my problem here? I too am trying to get all externally owned files OR folders in a shared folder structure while performing a large "shared folder" > "Shared Drive" migration project.

Eric

Ross Scroggs

unread,
Feb 13, 2024, 10:17:08 AM2/13/24
to google-ap...@googlegroups.com

Try this:
gam config csv_output_header_drop_filter "^owners$" redirect csv ./ExternallyOwnedFiles.csv user us...@ourdomain.org print filelist select <root folder ID> showownedby others fields id,name,owners.emailaddress

Ross

----
Ross Scroggs



Eric Hall

unread,
Feb 13, 2024, 4:03:31 PM2/13/24
to google-ap...@googlegroups.com
Bingo! Thanks, Ross!

Eric

Eric Hall


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/Mb582f-gmyo/unsubscribe.
To unsubscribe from this group and all its topics, 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/A6BB8F7B-261B-44F2-B9B0-05ED6A0AF785%40gmail.com.

Jon Pankhurst

unread,
Mar 7, 2024, 12:24:38 PM3/7/24
to GAM for Google Workspace
Will this work with share drives?

Ross Scroggs

unread,
Mar 7, 2024, 12:31:35 PM3/7/24
to google-ap...@googlegroups.com
Jon,

Files/folders on Shared Drives are not owned by users, they are owned by the Shared Drive itself.
You can list files that are accessible by non-domain users.

Ross
----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages