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 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | OneDrive | For business | Windows
Windows for business | Windows Server | User experience | PowerShell
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    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.