revoke sharepoint access

Rising Flight 3,996 Reputation points

Hi All

i have a user i want to revoke/block his one drive access. i cannot uncheck the option SharePoint online from licenses and Apps from office365 admin center as the membership is controlled by Azure AD. is there any other way to do this.

  1. if a user has access to many team sites and one drive, is there a way which i can block/revoke access from complete SharePoint.
SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,271 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,012 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,305 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 43,176 Reputation points Microsoft Vendor

    @Rising Flight

    1.You could use PowerShell to block a user's own OneDrive site access.

    Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking  
    $AdminSiteURL = ""  
    $OneDriveSiteURL = "the user's own OneDrive site URL"  
    Connect-SPOService -Url $AdminSiteURL –Credential (Get-Credential)  
    Get-SPOSite -Identity $OneDriveSiteURL | Set-SPOSite -LockState NoAccess  

    2.You could block sign-in for a user so that he cannot log into OneDrive and SharePoint.
    Go to Microsoft 365 admin center -> Active users -> Select the user -> Block sign-in.

    How to Disable OneDrive for Business in Office 365-SharePoint Online?
    How to properly deactivate a user in Office 365 and SharePoint?

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.

1 additional answer

Sort by: Most helpful
  1. Trevor Seward 11,691 Reputation points

    It is not possible to block a user from accessing OneDrive or SharePoint as long as they have permissions in OneDrive/SharePoint (i.e. a SharePoint site using 'Everyone - except external users'). This is because OneDrive and SharePoint do not perform license enforcement, i.e. just because you unassign the user's license, which for other applications (like Teams) does remove their ability to access the service, they will still be able to access ODfB/SPO where they have the appropriate permissions to.

    0 comments No comments