Script to delete Shared With Me links

Highlighted
New Contributor

Customer has a business requirement to delete all of a user's 'shared with me links' for compliance reasons.  Is there a way to do this with PowerShell and if so, can you point me to a sample script please?  Thanks in advance, Phil

3 Replies
Highlighted

here's an example script that gets that info for you:

 

https://techcommunity.microsoft.com/t5/OneDrive-for-Business/How-do-I-get-a-list-of-all-O4B-files-sh...

 

Removing the links is not included there though, but it's a good starting point.

Highlighted

Thanks for the post.  Is this for OneDrive for consumer?  Having trouble getting it to work with OneDrive for Business.

Highlighted
it should work for both, in addition you can also use eDiscovery as the thread mentions. That'd give you a list of URL's to retrieve.