This blog will help you to Lock and Unlock the SharePoint Online sites.
Sometimes, a user may request you delete the SharePoint site which they were using or might not be using for a long time. At that time, as an administrator, we should not go for deleting the tenant site collection.
We should prefer to lock the site for quite some period. After some time, we can go for deleting the SharePoint online site. Then only, we can secure the user data for some time.
Here we go! The below is the PowerShell script to lock and unlock the site.
-
- Connect-SPOService -URL https:
-
-
- $siteURL = “https:
-
-
- Set-SPOSite -Identity $siteURL -Lockstate “NoAccess”
-
-
- Set-SPOSite -Identity $siteURL -Lockstate “Unlock”
Conclusion
As per the end-user view, the site has been deleted from SharePoint and they will get “403 FORBIDDEN” message in the browser. In case, the end-user has changed his/her decision to restore the Site, we can easily Unlock it.