In the Sharepoint Online Management Shell my goal is to call the cmdlet Invoke-SPOSiteDesign (doc) with one fixed Design (i.e. the -Identity parameter) onto all SPOSites on my tenant.

I can get all sites with Get-SPOSite (doc) but I don't know how to chain those two commands together. Pseudo-Code wise, I want:

for every $url retrieved by Get-SPOSite:
    Invoke-SPOSiteDesign -Identity 0000-0000-0000 -WebUrl $url

Can you help me on how to express that best?


Use below code:

# Get all site collections
$siteCollections = Get-SPOSite

# loop through all site collections
foreach($siteCollection in $siteCollections) {
    Invoke-SPOSiteDesign -Identity 0000-0000-0000 -WebUrl $siteCollection.url

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.