Remove all shared links for one user Onedrive

Occasional Contributor



How can i remove all shared links in a users onedrive ? The user has hundreds of folders that he has shared, and i need to remove the share. How can i do this using poweshell? Again i dont want to remove the data, just the share link


Thank you

2 Replies
best response confirmed by skipster311-175 (Occasional Contributor)
Sure, you can use the Graph API for that. I have a sample script here:
Worked perfectly. Thanks!