Posts

Showing posts with the label Site Collection

Remove Deleted Site Collections from SharePoint Online

Cls Write-Host "Remove Deleted Site Collections" Write-Host "Password Please :" #Set-ExecutionPolicy RemoteSigned $username = "gaurav@goyal.com" $password=Read-Host -Prompt "Password" -AsSecureString; $siteAdminURL = "<<Main Tenent URL Here>>" Import-Module Microsoft.Online.SharePoint.PowerShell ā€“DisableNameChecking #$securePassword = ConvertTo-SecureString $password ā€“AsPlainText ā€“force $securePassword=$password $O365Credential = New-Object System.Management.Automation.PsCredential($username, $securePassword) Connect-SPOService -Url $siteAdminUrl -Credential $O365Credential Get-SPODeletedSite | foreach { Write-host "Deleting " $_.Url Remove-SPODeletedSite ā€“Identity $_.Url ā€“Confirm:$false } Disconnect-SPOService Write-Host "Removed Site Collections"