SOLVED

Remove all shared links for one user Onedrive

%3CLINGO-SUB%20id%3D%22lingo-sub-3278929%22%20slang%3D%22en-US%22%3ERemove%20all%20shared%20links%20for%20one%20user%20Onedrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3278929%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20i%20remove%20all%20shared%20links%20in%20a%20users%20onedrive%20%3F%20The%20user%20has%20hundreds%20of%20folders%20that%20he%20has%20shared%2C%20and%20i%20need%20to%20remove%20the%20share.%20How%20can%20i%20do%20this%20using%20poweshell%3F%20Again%20i%20dont%20want%20to%20remove%20the%20data%2C%20just%20the%20share%20link%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3278929%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3279283%22%20slang%3D%22en-US%22%3ERe%3A%20Remove%20all%20shared%20links%20for%20one%20user%20Onedrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3279283%22%20slang%3D%22en-US%22%3EWorked%20perfectly.%20Thanks!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3278985%22%20slang%3D%22en-US%22%3ERe%3A%20Remove%20all%20shared%20links%20for%20one%20user%20Onedrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3278985%22%20slang%3D%22en-US%22%3ESure%2C%20you%20can%20use%20the%20Graph%20API%20for%20that.%20I%20have%20a%20sample%20script%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F3018%2Fremove-sharing-permissions-on-all-files-in-users-onedrive-for-business%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F3018%2Fremove-sharing-permissions-on-all-files-in-users-onedrive-for-business%3C%2FA%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello

 

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)
Solution
Sure, you can use the Graph API for that. I have a sample script here: https://www.michev.info/Blog/Post/3018/remove-sharing-permissions-on-all-files-in-users-onedrive-for...
Worked perfectly. Thanks!