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).

  1. Login Microsoft 365 Admin Center

  2. Navigate to SharePoint Admin Center

  3. Click on More Feature

  4. Open User Profile

  5. Click on Manage User Profile

  6. Search for the User

  7. Select the User and Click on the dropdown

  8. Click on Manage Site Collection Owners

  9. 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.

M365 One Drive Access to Specific Users | Joseph Ludwig