web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove all sharing lin...
Power Automate
Unanswered

Remove all sharing links from all folders

(0) ShareShare
ReportReport
Posted on by 188

Hello! 

 

Using flow, 

  • Is it possible to remove ALL shared links from every single folder and file that's within a document library no matter how deep the tree is? OR
  • is there a setting that can be toggled that will turn off sharing (both internal and external) and will it delete all sharing links? OR
  • remove everyone, no matter what, except one account - a service account - so everyone loses access including shared links? 

EDIT: Many folder have unique permissions. 

 

the idea is to

1. set a site for archive - this is where i need to change "edit" to "read" access for everyone who is part of a group which i achieved but not with shared links as i am not sure how to remove it.

2. wait 7 days and move document library to a archive location (achieved) 

3. delete the site (acheived)

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @rjack ,

     

    You could use 'get files' list all files and use 'Stop sharing an item or a file' to stop sharing them.

    vbofengmsft_0-1672713258881.png

     

    Best Regards,

    Bof

     

     

    Best Regards,

    Bof

     

  • rjack Profile Picture
    188 on at

    @v-bofeng-msft thanks! that's my plan b if i could not have a simpler solution to remove sharing permission to both folder and files at the same time - i was hopping for http request - in one step. with this get files and stop sharing solution, I need need 2 steps one for folder and the other for files. 

  • rjack Profile Picture
    188 on at

    @v-bofeng-msft 

    question: this "get files" will get every single file whether it is shared or not and "stop sharing", i assume, will run whether the file has sharing link or not. get files has number of returned file count limitation. some of our project document libraries are huge that exceed 10k files and/or folders and goes beyond 150 gb as well. 

     

    Could you make some suggestions on how i can get all files without limit (which is impossible) so i can run this step just once OR get only the files and folders that has sharing links on it - which can be done through batches if I can use filters? 

  • aniuafen Profile Picture
    19 on at

    Hi, I am looking into the same challenge and what I am thinking of doing is using the usage report for SharePoint site (it is just under Site Usage and you request it and you receive email when it is done) and use it as a database of shared files and crawl through that. I have thousands of files to go through, but I might just mark on the spreadsheet (that's how the report is prepared) in one Power Automate step when the permissions will be revoked and use Do Until function with get items and and length function and Do Until the length of the batch is 0. 
    I will be preparing it so if you are interested I can save this page to share when it is ready.

  • geo-geo Profile Picture
    3 on at

    Hello - I like your idea, but never used Power Automate. Could you please share the Power Automate script when ready and tested? Thanks

  • aniuafen Profile Picture
    19 on at

    Will have it in mind, that's not a priority but defo will be done in couple of months!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard