Delete all sharing links of SharePoint / Teams / One Drive

Wolfgang-2637 0 Reputation points
2024-11-22T09:54:39.7466667+00:00

Hi,

we need to reset (delete) all manual setup sharing links of files inside MS Teams and OneDrive. I am able to list alle teams and all including channels via PowerShell but I don't know how to list the files and then to get the sharing info of these files.

Can someone help me how to list the files and their sharing links - to later remove them.

Thanks

Wolfgang

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,396 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,904 questions
OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,287 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,640 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 108.7K Reputation points MVP
    2024-11-22T16:09:12.5633333+00:00

    I published a PowerShell script to do just that a while ago, check it out: https://www.michev.info/blog/post/3018/remove-sharing-permissions-on-all-files-in-users-onedrive-for-business

    If you just want to report on shared items, here's a more recent script: https://www.michev.info/blog/post/6154/report-on-externally-shared-files-via-the-graph-api


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.