0

I was trying to create a subsite from a saved template. I keep getting an error.

Action can not be completed.

I have all the permissions.

Is there a different way to do this?

  • what's the error that you got? – Mohamed El-Qassas MVP Nov 18 '16 at 21:36
  • Sorry something went wrong, unexpected error has occured. Tried to see the logs with the coorelation ID but nothing there. – dkorra Nov 18 '16 at 21:47
0

To do this you should go under site settings->site actions->save site as template. Once you get to the next screen, I would not include content, it doesn't seem as if that is what you want to do.

After saving the template it will be sent to your solutions gallery. While on the add a new subsite screen, the template should be listed under "custom".

enter image description here

  • Yes the template is still there but I will get error when creating the subsite – dkorra Nov 18 '16 at 21:10
0

You can achieve this with the help of PowerShell , below are the steps:

This can be achieved using power shell and CSOM by following below steps .

Once the custom template is uploaded into the solution gallery of the site collection execute the below commands in Powershell:

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web ServerExtensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web ServerExtensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

$Site = "SiteCollectionURL"
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($Site)

List Custom Templates

$Templates = $Context.Site.GetWebTemplates("1033","0")
$Context.Load($Templates)
$Context.ExecuteQuery()
$Templates | Where {$_.Name -like "*{*" } | Select Name, Description

This will list out all the custom templates available in the gallery.

And execute the below commands to create the subsite using the custom template:

Create Sub-Web using the Custom Template

$WCI = New-Object Microsoft.SharePoint.Client.WebCreationInformation
$WCI.WebTemplate = "{516EB07D-8711-4B9F-A3AD-097B28C5CDDF}#MyCustomTemplate"
$WCI.Description = "MyNewSubSite"
$WCI.Title = "MyNewSubSite"
$WCI.Url = "MyNewSubSite"
$WCI.Language = "1033"
$SubWeb = $Context.Web.Webs.Add($WCI)
$Context.ExecuteQuery().

courtesy : https://blogs.technet.microsoft.com/fromthefield/2015/10/21/create-a-subsite-web-using-a-custom-template-in-sharepoint-online-using-powershell-and-csom/

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.