You can use the Remove-SPOSite
cmdlet for that, simply provide the URL for the user's OneDrive for Business site collection. Of course, make sure that users have saved any data before going that route.
Disabling OneDrive Access and Removing Data for Specific Users via PowerShell
I would like to explore options for deleting specific users' OneDrive data using a PowerShell script. I have around 1500+ active users with OneDrive access, and I want to disable OneDrive access for around 500+ specific users and remove the files from their OneDrive.
Is there a way to disable OneDrive access for these specific users and remove the data from their OneDrive?
I am the Global Administrator of the tenant.
2 answers
Sort by: Most helpful
-
Vasil Michev 108.6K Reputation points MVP
2024-11-02T15:25:26.97+00:00 -
Jiajing Hua-MFST 11,360 Reputation points Microsoft Vendor
2024-11-04T06:40:05.8133333+00:00 When you permanently delete a OneDrive, you will not be able to restore it. Please check following link:
https://learn.microsoft.com/en-us/sharepoint/restore-deleted-onedrive#permanently-delete-a-onedrive
(Since the web site is not hosted by Microsoft, the link may changed without notice. )********************************************
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.