Block One Drive Access for M365 Users
Blocking OneDrive access for users in your organization, a crucial step in managing data security and compliance. There are times when you may need to restrict access to OneDrive due to policy changes, role adjustments, or security concerns.
OFFICE 365
6/3/20231 min read
Disable One Drive Access to Users (Remove Permission to their One Drive)
For business reasons, we need to disable OneDrive access for existing users without losing their data, while ensuring they continue to have access to SharePoint.
Prerequisites
M365 Admin Access: You need to have the necessary admin permissions (SharePoint Administrator or Global Administrator).
Navigate to SharePoint Admin Center
Click on More Feature
Open User Profile
Click on Manage User Profile
Search for the User
Select the User and Click on the dropdown
Click on Manage Site Collection Owners
Remove the Actual User and Add Administrator ID
PowerShell Script to Get the Current Owners of the One Drive
Get-SPOSite -IncludePersonalSite $true | select url, Owner | Export-Csv -Path “C:TempCurrentOneDriveOwners.csv”
PowerShell Script to Change the Current Owners to Administrator
Import-CSV C:TempChangeOneDrivetoAdmin.csv | foreach-object { Set-SPOSite -Identity $_.Url -Owner $_.Owner}
If you want to enable OneDrive for a specific group of users, please follow this link.