Add-SPOSiteDesignTask : Operation is not valid due to the current state of the object.

Copper Contributor

I have created site design with two site scripts. applied using below command

$Sitedesignout1=Add-SPOSiteDesign -Title "Site Design 2" -WebTemplate "68" -SiteScripts $result1.Id,$result2.Id -Description "Site Desin Sample"

 

But after try to apply Site design using below code throwing an Operation is not valid due to the current state of the object error

 

$adminSiteUrl = "https://myadmin-admin.sharepoint.com"

$siteUrl = "https:// myadmin.sharepoint.com/sites/PracticeSiteDesign"

$siteDesignId = "04d0e647-5912-4ef7-8069-9186cebb2192"

 

Connect-SPOService $adminSiteUrl

$task = Add-SPOSiteDesignTask -SiteDesignId $siteDesignId -WebUrl $siteUrl

Add-SPOSiteDesignTask : Operation is not valid due to the current state of the object.

At line:6 char:9

+ $task = Add-SPOSiteDesignTask -SiteDesignId $siteDesignId -WebUrl $si ...

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Add-SPOSiteDesignTask], ServerException

    + FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.AddSPOSiteDesignTask

 

0 Replies