02-20-2020 10:04 PM
02-20-2020 10:04 PM
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"
$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
02-21-2020 09:12 AM
@Dinesh Bhat I've historically encountered this same error, albeit not with the SPOSiteDesignTask cmdlet. Have you ensured that the site that you're trying to interact with is not being edited by anybody else at the time that the command is running, and that any pending changes have been published? Have you also encountered this same issue with different site designs, or is it only this site design which has been presenting issues?
Hope this helps!
02-21-2020 01:41 PM - edited 02-21-2020 01:42 PM
@rowanhucklebridge , Thanks for the reply. I have created new site without any additional content. So there is no pending changes and I am the only person having access to the site.
if I create site design for each site script its working good. But only problem I need register multiple site design to tenant.
if I combine site script and registered as one site design, throwing below error.
Please share your thought
02-24-2020 01:01 AM
@Dinesh Bhat I'm not sure how much help I can be here. Whenever I've previously received the same error message that you've been receiving - "Operation is not valid due of the current state of the object" - it usually means that whatever I am attempting to edit or modify cannot currently be modified, for instance if it is already undergoing edits or changes. So whilst I don't think I'm able to suggest a fix for you, I might be able to help diagnose where things are going wrong.
To this end, do you have multiple site scripts interact with the same sections/functions/areas? Could this be where the issue is coming from?
by Charlie Jones on May 27, 2020
by EmmaLewisMHPA on May 27, 2020
by Chris Cundy on May 27, 2020
by Mark Kashman on May 27, 2020
by Mark Kashman on May 26, 2020
by Cathy Dew on May 21, 2020