Create Site Collection

Jul 21, 2011 at 11:43 AM

Is there a chance to create Site Collections by using the Create Site Action?

I would like to run a workflow automatically after Adding a new item to a list in (for example) who creates a site collection (for example)

Thanks for your help!

Sep 23, 2011 at 2:28 AM

Did you ever get this working? I am able to kick off a site collection creation but the powershell workflow action seems not to be able to set a template upon creation.

Oct 5, 2011 at 2:10 PM

Hello. I am also curious if you were able to create a Site Collection using the "Create a Site" Action?

If not, is it possible to do this through "Execute PowerShell" action using the "New-SPSite" cmdlet?

Oct 9, 2011 at 4:21 PM


this is possbile. I would not recommend using the SharePoint PowerShell snapin.  I would try it like this:

$webApp = [Microsoft.SharePoint.SPWebApplication]::Lookup("http://mywebapp")






Oct 10, 2011 at 11:30 AM
Edited Oct 10, 2011 at 11:41 AM

Thanks a lot Christian. This works perfectly.

In previous attempts I used $site.WebApplication.Sites.Add(...). This doesn't work because you're opening the WebApplication from the context of the workflow user.

For people who are trying the same, use the method Christian described: use [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(...)

I was not able to use standard SP2010 cmdlets using the SharePoint PowerShell snapin. But you're able to use the whole object model, so the possibilities are limitless.

Jan 5, 2012 at 12:47 PM
Edited Jan 5, 2012 at 12:48 PM

Executing the SPWebApplication.Sites.Add() method gives me some Permission errors if I am using a standard Web Application Pool account. This account does not have any permissions to the Configuration DB. Running a Workflow from the Central Administration that creates a Site Collection through the method mentioned above is no problem, since the CA is running under the SPFarm account.

If you still would like to achieve to create Site Collections through a normal WebApplication, don't bother giving your Web Application Pool more permissions (that would be crap!!) but use the method underneath:

$webApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup(http://someurl) 
if ($webApp.SelfServiceSiteCreationEnabled) 
$siteCollection = $webApp.Sites 
$newSite = $siteCollection[0].SelfServiceCreateSite($ProjectSiteUrl, $ProjectName, "", 1033, "{F90E6CBE-49BE-4F78-A937-191DD04BLAA}#SomeSiteDefinition", $Owner, "Username",, $Owner, "Username",,) 

This method requires a lot less permissions, and you won't ****-up your least priviliges principles. Needless to mention you need to enable the SelfServiceSiteCreation on the Web Application your running the Workflow under.