Skip to content

SiteDesign

Best practise

List templates

Modern Site Provisioning

Deploying

Flow / REST

Reports

Success runs

Get-SPOSite -Limit All | ForEach-Object {  
  $failedRuns = Get-SPOSiteDesignRun $_.Url | Get-SPOSiteDesignRunStatus | Where-Object {$_.OutcomeCode -ne "Success"};

  if($failedRuns) {
    Write-Output $_.Url
    $failedRuns
  }
}

Failed runs

Get-SPOSite -Limit All | ForEach-Object {  
  $failedRuns = Get-SPOSiteDesignRun $_.Url | Get-SPOSiteDesignRunStatus | Where-Object {$_.OutcomeCode -eq "Faulure"};

  if($failedRuns) {
    Write-Output $_.Url
    $failedRuns
  }
}

Tips

Know how many Site Designs and Site Scripts you have:

(Get-SPOSiteDesign | Measure).Count
(Get-SPOSiteScript | Measure).Count

Delete a Site Design or a Site Script based on its unique identifier:

Remove-SPOSiteDesign -Identity $siteDesignId
Remove-SPOSiteScript -Identity $siteScriptId

Delete all Site Designs or Site Scripts at once:

```Powershell
Get-SPOSiteDesign | foreach { Remove-SPOSiteDesign -Identity $_.Id }
Get-SPOSiteScript | foreach { Remove-SPOSiteScript -Identity $_.Id }