revoke sharepoint access

Rising Flight 6,096 Reputation points
2021-02-17T19:08:39.237+00:00

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.
Exchange Online
Exchange Online
A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Answer accepted by question author
  1. Emily Du-MSFT 51,941 Reputation points Microsoft External Staff
    2021-02-18T08:04:29.55+00:00

    @Rising Flight

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

    Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking  
    
    $AdminSiteURL = "https://tenant-admin.sharepoint.com"  
    $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.

    Reference:
    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. trevorseward 11,711 Reputation points
    2021-02-18T16:35:52.113+00:00

    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.