1

Is there any way to create a site collection in SharePoint Online using the blank site template, STS#1 via PowerShell?

I have attempted to do so already using the New-PnPTenantSite cmdlet and providing STS#1 as the Template parameter but it returns an error message saying the web template is not available.

Is there any workaround to allow me to create a blank site collection?

What I'm ultimately trying to achieve is creating a new classic site collection and applying a web template to it which I have in a WSP file. The steps I was hoping could achieve this were:

  1. Create a blank site collection
  2. Upload, install and activate the web template WSP to the site collection
  3. Apply the web template to the root web of the site collection

2 Answers 2

3

That's correct, the STS#1, or Blank site template, is not available in SharePoint Online, but that's not what you want anyway. You can't apply a template to a site that already has a template.

What you want to do is use the "select template later" option. In the UI, click the "Custom" tab and "Select Template Later".

enter image description here

Then once the site is created you can upload your WSP.

enter image description here

If you need to do this programmatically you can call New-PnPTenantSite with no Template parameter. This will acheive the same thing.

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/new-pnptenantsite?view=sharepoint-ps

1
  • 1
    Thanks for your answer. I need to do this with PowerShell. I should have mentioned I already tried New-PnPTenantSite with no value for the Template parameter but this creates a site collection with the team site template, despite what the documentation says. So I'm a bit stuck at the moment.
    – Submits
    Commented Mar 28, 2019 at 22:07
0

To achieve the above requirement from PowerShell way use below.

Note: we need to explicitly mention the -template switch with no value i.e., "" (blank double quotes)

$conn = Connect-PnPOnline -Url "https://test-admin.sharepoint.com" -Credential (Get-credential)
New-PnPTenantSite -Title test -Url /sites/testhello1 -Owner "[email protected]" -TimeZone 4 -Template "" -Connection $conn

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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