Powershell to unlock SharePoint Online site

Hello friends, below is the script that will help you to unlock your sharepoint online site:

#Change your tenant admin account below
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 
$username = "[email protected]"
$password = ConvertTo-SecureString "[email protected]" –asplaintext –force   
#$password = convertto-securestring "YourPassword" -asplaintext -force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $password

#Must be SharePoint Admin URL
$siteUrl = "https://myclassbook-admin.sharepoint.com"
Connect-SPOService -Url $siteUrl -Credential $cred
    
$site="https://myclassbook.sharepoint.com/teams/testsite"         
Set-SPOSite -Identity $site -LockState "Unlock" 

Download:

powershell to unlock single site

Leave a Reply

Your email address will not be published. Required fields are marked *