How to Create SharePoint Site Collection with PowerShell

Categories: PowerShell, SharePoint
#Use SharePoint 2013 Management Shell
#Parameters

#Url Site
$Url = 'http://mysite.vincenzonardone.it'
#Url Web Application
$HostHeaderWebApp = 'http://server_name:41000'
$Name = 'MySite Vincenzo Nardone'
$Description = 'Personal Site'
$OwnerAlias = 'domail\user'
$OwnerEmail = 'mail@domain.it'
$SecondaryOwnerAlias = 'domail\user2'
$SecondaryEmail = 'mail2@domain.it'
#LCID Decimal
$Language = '1033'
#Get-SPWebTemplate (Command to get a list of all the templates in SharePoint environment)
$Template = 'PRODUCTCATALOG#0'

#Create Site Collection

New-SPSite $Url -HostHeaderWebApplication $HostHeaderWebApp -Name $Name -Description $Description -OwnerAlias $OwnerAlias -OwnerEmail $OwnerEmail -SecondaryOwnerAlias $SecondaryOwnerAlias -SecondaryEmail $SecondaryEmail -language $Language -Template $Template
«
»

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.