Sunday, October 6, 2019

Lock/Unlock the site Collection in SharePoint Online using PowerShell

#Connect to SP Online
Connect-SPOService -Url https://ajtech-admin.sharepoint.com -credential ajadmin@ajtech.com

#get site collection that you want to lock/unlock
$site = "https://ajtech.sharepoint.com/sites/test"

#Lock the Site collection
Set-SPOSite -Identity $site -Lockstate "NoAccess"

#Unlock the Site collection
Set-SPOSite -Identity $site -Lockstate "Unlock"

No comments:

Post a Comment