viernes, 8 de marzo de 2013

Creating a new Sharepoint WebApplication and a Sharepoint Site Collection:

# SharePoint cmdlets
Add-PsSnapin Microsoft.SharePoint.PowerShell
# Set variables
$WebAppName = "Contoso Sharepoint1"
$WebAppHostHeader = "sharepoint1.contoso.com"
$WebAppPort = 80
$WebAppAppPool = "SharePoint1AppPool"
# This User has to be a Sharepoint Manager Account
$WebAppAppPoolAccount = "contoso\sp_serviceuser"
$WebAppDatabaseName = "Sharepoint1"
$WebAppDatabaseServer = "SQLServer\InstanceName"
$SiteCollectionName = "Homepage"
$SiteCollectionURL = ("http://" + $WebAppHostHeader)
$SiteCollectionTemplate = "STS#0"
$SiteCollectionLanguage = 1033
$SiteCollectionOwner = "contoso\UserName"

# Create a new Sharepoint WebApplication
New-SPWebApplication -Name $WebAppName -Port $WebAppPort -HostHeader $WebAppHostHeader -URL ("http://" + $WebAppHostHeader) -ApplicationPool $WebAppAppPool -ApplicationPoolAccount (Get-SPManagedAccount $WebAppAppPoolAccount) -DatabaseName $WebAppDatabaseName -DatabaseServer $WebAppDatabaseServer

# Create a new Sharepoint Site Collection
New-SPSite -URL $SiteCollectionURL -OwnerAlias $SiteCollectionOwner -Language $SiteCollectionLanguage -Template $SiteCollectionTemplate -Name $SiteCollectionName

No hay comentarios:

Publicar un comentario