
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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
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.
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.