Created
December 5, 2013 21:59
-
-
Save chrisobriensp/7814727 to your computer and use it in GitHub Desktop.
Recreating a site collection using the SPO cmdlets.
This file contains 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
. .\PS_SPO_TopOfScript.ps1 | |
# replace these details - parameters for new site collection.. | |
$siteCollectionUrl = "Your site URL here.." | |
$owner = $username | |
$storageQuota = 100 | |
$resourceQuota = 30 | |
$localeID = 1033 | |
$timeZoneID = 2 # (GMT London) | |
if ($connected) | |
{ | |
Write-Host "Removing site collection $siteCollectionUrl - please wait.." | |
Remove-SPOSite $siteCollectionUrl -Confirm:$false | |
Write-Host "Now deleting from recycle bin.." | |
Remove-SPODeletedSite $siteCollectionUrl -Confirm:$false | |
Write-Host "Creating new site collection (no template) at $siteCollectionUrl - please wait.." | |
New-SPOSite -Url $siteCollectionUrl -Owner $owner -StorageQuota $storageQuota -LocaleId $localeID -ResourceQuota $resourceQuota -TimeZoneId $timeZoneID | |
Disconnect-SPOService | |
Write-Host "Completed" -ForegroundColor Green | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment