martes, 30 de abril de 2013

Creating a Site Collection with PowerShell


Once you have your web application provisioned, you will need to create a site collection with a top level site. The New-SPSite cmdlet allows you to create a new top level site with the URL and owner specified in the –URL and –OwnerAlias. You will also notice that we have the ability to configure our tenant administration. In fact, in order to configure multi-tenants, you must use PowerShell. The site templates available in SharePoint Foundation include the following:

List with > Get-SPWebTemplate
  • GLOBAL#0             Global template
  • STS#0                Team Site
  • STS#1                Blank Site
  • STS#2                Document Workspace
  • MPS#0                Basic Meeting Workspace
  • MPS#1                Blank Meeting Workspace
  • MPS#2                Decision Meeting Workspace
  • MPS#3                Social Meeting Workspace
  • MPS#4                Multipage Meeting Workspace
  • CENTRALADMIN#0       Central Admin Site
  • WIKI#0               Wiki Site
  • BLOG#0               Blog
  • SGS#0                Group Work Site
  • TENANTADMIN#0        Tenant Admin Site
  • ACCSRV#0             Access Services Site
  • ACCSRV#1             Assets Web Database
  • ACCSRV#3             Charitable Contributions Web Database
  • ACCSRV#4             Contacts Web Database
  • ACCSRV#6             Issues Web Database
  • ACCSRV#5             Projects Web Database
  • BDR#0                Document Center
  • OFFILE#0             (obsolete) Records Center
  • OFFILE#1             Records Center
  • OSRV#0               Shared Services Administration Site
  • PowerPointBroadca... PowerPoint Broadcast Site
  • PPSMASite#0          PerformancePoint
  • BICenterSite#0       Business Intelligence Center
  • SPS#0                SharePoint Portal Server Site
  • SPSPERS#0            SharePoint Portal Server Personal Space
  • SPSMSITE#0           Personalization Site
  • SPSTOC#0             Contents area Template
  • SPSTOPIC#0           Topic area template
  • SPSNEWS#0            News Site
  • CMSPUBLISHING#0      Publishing Site
  • BLANKINTERNET#0      Publishing Site
  • BLANKINTERNET#1      Press Releases Site
  • BLANKINTERNET#2      Publishing Site with Workflow
  • SPSNHOME#0           News Site
  • SPSSITES#0           Site Directory
  • SPSCOMMU#0           Community area template
  • SPSREPORTCENTER#0    Report Center
  • SPSPORTAL#0          Collaboration Portal
  • SRCHCEN#0            Enterprise Search Center
  • PROFILES#0           Profiles
  • BLANKINTERNETCONT... Publishing Portal
  • SPSMSITEHOST#0       My Site Host
  • ENTERWIKI#0          Enterprise Wiki
  • SRCHCENTERLITE#0     Basic Search Center
  • SRCHCENTERLITE#1     Basic Search Center
  • SRCHCENTERFAST#0     FAST Search Center
  • visprus#0            Visio Process Repository

The Cmdlet


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>]] [<CommonParameters>]

The Script


$siteURL http://lab.ps4sp.com&#8221;
$owner “PS4SPShannon”
$secondOwner “PS4SPAdministrator”
$template “STS#0″
$description “This is a sample site that was built using PowerShell.”
New-SPSite $siteURL -OwnerAlias $owner -SecondaryOwnerAlias $secondOwner -name “PowerShell for SharePoint” -Template $template -Description$description

No hay comentarios:

Publicar un comentario