revoke sharepoint access

Rising Flight 4,596 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.
SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,374 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,828 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,578 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 47,301 Reputation points Microsoft Vendor
    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. Trevor Seward 11,706 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 Answers by the question author, which helps users to know the answer solved the author's problem.