New-SPSite

Creates a new site collection at the specified URL.

Syntax

New-SPSite
   [-Url] <String>
   -OwnerAlias <SPUserPipeBind>
   [-AdministrationSiteType <SPAdministrationSiteType>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-CompatibilityLevel <Int32>]
   [-Confirm]
   [-ContentDatabase <SPContentDatabasePipeBind>]
   [-Description <String>]
   [-HostHeaderWebApplication <SPWebApplicationPipeBind>]
   [-Language <UInt32>]
   [-Name <String>]
   [-OverrideCompatibilityRestriction]
   [-OwnerEmail <String>]
   [-QuotaTemplate <SPQuotaTemplatePipeBind>]
   [-SecondaryEmail <String>]
   [-SecondaryOwnerAlias <SPUserPipeBind>]
   [-SiteSubscription <SPSiteSubscriptionPipeBind>]
   [-Template <SPWebTemplatePipeBind>]
   [-WhatIf]
   [-CreateFromSiteMaster]
   [<CommonParameters>]

Description

The New-SPSite cmdlet creates a new site collection with the URL and owner that the Url and OwnerAlias parameters. This cmdlet can create site collections in either the SharePoint Server mode which uses the legacy versions of templates and features, or can be created in SharePoint Server mode which uses the new versions of templates and features.

For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at http://go.microsoft.com/fwlink/p/?LinkId=251831 (http://go.microsoft.com/fwlink/p/?LinkId=251831).

Examples

------------------EXAMPLE 1-----------------------

C:\PS>New-SPSite http://<site name>/sites/test -OwnerAlias "DOMAIN\JDoe" -Language 1033

This example creates an English site collection at http://<site name>/sites/test that is owned by user DOMAIN\Jdow.

------------------EXAMPLE 2-----------------------

C:\PS>$w = Get-SPWebApplication http://<site name>

C:\PS>New-SPSite http://www.contoso.com -OwnerAlias "DOMAIN\jdow" -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-----------------------

C:\PS>Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-SPSite http://<site name</sites/test -OwnerAlias DOMAIN\jdow -Template $_ }

This example creates a site collection by using the "Team Site" Web template.

------------------EXAMPLE 4-----------------------

C:\PS>New-SPSite -URL http://<site name>/sites/testsite -OwnerAlias "DOMAIN\JDow" -Language 1033 -CompatibilityLevel 14

This example creates an English 14 mode site collection by using the Team site template at http://<site name>/sites/testsite that is owned by user DOMAIN\Jdow

Required Parameters

-OwnerAlias

Specifies the user login name of the site owner.

The type must be a valid user alias, in the form, Domain\username.

Type:SPUserPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-Url

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.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016

Optional Parameters

-AdministrationSiteType

Specifies the site type.

Valid values are None or TentantAdministration.

Type:SPAdministrationSiteType
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-AssignmentCollection

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.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-CompatibilityLevel

Specifies the version of templates to use when creating a new SPSite object. This value sets the initial CompatibilityLevel value for the site collection. The values for this parameter can be either SharePoint Server. When this parameter is not specified, the CompatibilityLevel will default to the highest possible version for the web application depending on the SiteCreationMode setting.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-Confirm

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-ContentDatabase

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.

Type:SPContentDatabasePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-CreateFromSiteMaster

{{Fill CreateFromSiteMaster Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2016
-Description

Describes the new site. If no value is specified, the value is left blank.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-HostHeaderWebApplication

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 one of the following forms:

--WebApplication-1212 --A URL (for example, http://server_name) --A GUID (for example, 1234-5678-9876-0987)

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-Language

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).

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-Name

Specifies the title of the new site collection. If no name is specified, the default name is applied.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-OverrideCompatibilityRestriction

{{ Fill OverrideCompatibilityRestriction Description}}

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-OwnerEmail

Specifies the email address of site owner. If no value is specified, the value is left blank.

The type must be a email address in the form, someone@example.com.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-QuotaTemplate

Specifies the quota template for the new site. The template must exist already. If no template is specified, no quota is applied.

Type:SPQuotaTemplatePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-SecondaryEmail

Specifies the email address of the secondary site owner. If no value is specified, the value is left blank.

The type must be a email address, in the form, someone@example.com.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-SecondaryOwnerAlias

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.

Type:SPUserPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-SiteSubscription

Specifies the Site Group to get site collections.

Type:SPSiteSubscriptionPipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-Template

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.

Type:SPWebTemplatePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016