Last active
June 19, 2019 09:49
-
-
Save kasuken/cd682973421bb68aa780c00c6f4cc3a3 to your computer and use it in GitHub Desktop.
Powershell script to remove an SPOsite (from the recycle bin, as well)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$username = "" | |
$password = "" | |
$Password = ConvertTo-SecureString -String $password -AsPlainText -Force; | |
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password | |
Connect-SPOService -Url "https://[tenant]-admin.sharepoint.com" -Credential $Credentials | |
Get-SPODeletedSite | Remove-SPODeletedSite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$username = "" | |
$password = "" | |
$webUrlToDelete = "[urlToDelete]"; | |
$Password = ConvertTo-SecureString -String $password -AsPlainText -Force; | |
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password | |
Connect-SPOService -Url "https://[tenant]-admin.sharepoint.com" -Credential $Credentials | |
Remove-SPOSite -Identity $webUrlToDelete -NoWait | |
Remove-SPODeletedSite -Identity $webUrlToDelete -NoWait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment