Omar El-Anis – 365 Developer

My experiences with SharePoint, Flows, PowerApps, JavaScript and all of the other lovely web technologies out there!

Uncategorised

Force delete site form recycle bin in SharePoint Online Admin Tenancy

If you find yourself in the situation where you have deleted a site from the admin centre but need to create a site with the same name you won’t be able to until the site is removed from the admin recycle bin, to delete the site from the recycle bin run the following script in PowerShell – remember to change the relevant fields to match your tenancy


$username = "username@domain.com"
$password = Read-Host "Please enter the password for $($userName)" -AsSecureString
$URL = 'https://tenant.sharepoint.com/teams/siteURL'
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-SPOService -Url https://TENANCY-admin.sharepoint.com -Credential $cred
Remove-SPODeletedSite -Identity $URL

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments