New-SPSite
Applies to: SharePoint Server 2010, SharePoint Foundation 2010
Topic Last Modified: 2010-07-21
Creates a new site collection at the specified URL.
New-SPSite [-Url] <String> -OwnerAlias <SPUserPipeBind> [-AdministrationSiteType <None | TenantAdministration>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-ContentDatabase <SPContentDatabasePipeBind>] [-Description <String>] [-HostHeaderWebApplication <SPWebApplicationPipeBind>] [-Language <UInt32>] [-Name <String>] [-OwnerEmail <String>] [-QuotaTemplate <SPQuotaTemplatePipeBind>] [-SecondaryEmail <String>] [-SecondaryOwnerAlias <SPUserPipeBind>] [-SiteSubscription <SPSiteSubscriptionPipeBind>] [-Template <SPWebTemplatePipeBind>] [-WhatIf [<SwitchParameter>]]
The New-SPSite cmdlet creates a new site collection by using the URL and owner specified by the Url and OwnerAlias parameters.
| Parameter | Required | Type | Description | ||
|---|---|---|---|---|---|
| Url | Required | System.String | Specifies the URL that the new site collection uses. If the URL is not a host header site, the URL must start with the the Web application URL. | ||
| OwnerAlias | Required | System.String | Specifies the user login name of the site owner. The type must be a valid user alias, in the form Domain\username. | ||
| AdministrationSiteType | Optional | Microsoft.SharePoint.SPAdministrationSiteType | Specifies the site type. Valid values are None or TentantAdministration. | ||
| AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection | Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
| ||
| Confirm | Optional | System.Management.Automation.SwitchParameter | Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters | ||
| ContentDatabase | Optional | Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind | Specifies the name or GUID of the content database in which to create the new site. If no content database is specified, the site collection is selected automatically. The type must be a valid database name, in the form SiteContent1212, or a GUID, in the form 1234-5678-9807. | ||
| Description | Optional | System.String | Describes the new site. If no value is specified, the value is left blank. | ||
| HostHeaderWebApplication | Optional | Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind | Specifies that if the URL provided is a host header, the HostHeaderWebApplication parameter must be the name, URL, GUID, or SPWebApplication object for the Web application in which this site collection is created. If no value is specified, the value is left blank. The type must be a valid name, in the form WebApplication-1212; a URL (for example, http://server_name); or a GUID (for example, 1234-5678-9876-0987). | ||
| Language | Optional | System.Int32 | Specifies the language ID for the new site collection. If no language is specified, the site collection is created with the same language that was specified when the product was installed. This must be a valid language identifier (LCID). | ||
| Name | Optional | System.String | Specifies the title of the new site collection. If no name is specified, the default name is applied. | ||
| OwnerEmail | Optional | System.String | Specifies the e-mail address of site owner. If no value is specified, the value is left blank. The type must be a valid e-mail address in the form, someone@example.com. | ||
| QuotaTemplate | Optional | Microsoft.SharePoint.PowerShell.SPQuotaTemplatePipeBind | Specifies the quota template for the new site. The template must exist already. If no template is specified, no quota is applied. | ||
| SecondaryEmail | Optional | System.String | Specifies the e-mail address of the secondary site owner. If no value is specified, the value is left blank. The type must be a valid e-mail address, in the form someone@example.com. | ||
| SecondaryOwnerAlias | Optional | System.String | Specifies the user login credentials of the secondary site owner. If no value is specified, the value is left blank. The type must be a valid user alias, in the form Domain\username. | ||
| SiteSubscription | Optional | Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind | Specifies the Site Group to get site collections. | ||
| Template | Optional | Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind | Specifies the Web template for the root Web of the new site collection. The template must be already installed. If no template is specified, no template is provisioned. | ||
| WhatIf | Optional | System.Management.Automation.SwitchParameter | Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters |
------------------EXAMPLE 1-----------------------
New-SPSite http://sitename/sites/test -OwnerAlias "DOMAIN\JDoe" -Language 1033
This example creates an English site collection at http://sitename/sites/test that is owned by user DOMAIN\Jdoe.
------------------EXAMPLE 2-----------------------
$w = Get-SPWebApplication http://sitename
New-SPSite http://www.contoso.com -OwnerAlias "DOMAIN\jdoe" -HostHeaderWebApplication $w -Name "Contoso" -Template "STS#0"
This example creates a host header site collection. Because the template is provided, the root Web of this site collection will be created.
------------------EXAMPLE 3-----------------------
Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-SPSite http://sitename/sites/test -OwnerAlias DOMAIN\jdoe -Template $_ }
This example creates a site collection by using the "Team Site" Web template.

Note