Overview
Go Site Actions->Site Settings and under the Galleries section click on Provisioner Scripts. Then make sure you add the following one item for each template that you want to secure:
provisioner.jpg
  • Web Templates column. Here you must specify the WebTemplate name of the site being used followed by a # and the Configuration of the template (WebTemplate#Configuration):
NOTE
- You can determine this information by opening an instance of SharePoint Manager 2010 and browsing to the Site and accessing the Properties Tab in SharePoint 2010 Manager.
- For sites provisioned from Site Templates in SP2010 (Site Template User Solutions), the name to be matched is the name of the Solution itself. E.g. specify projectsite1.wsp for a site template that was saved as projectsite1. Case is sensitive
  • Script to Execute column. This is the xml that the provisioner uses. It is further explained below in the Schema section.


Schema
<Provisioner ShowErrors="true" ApplyWebTemplate="TemplateName.stp" ReopenWebs="false">
  <FixupWebACL RespectInheritanceSetting="false" RoleAssignments="BreakClean" SyncGroupQuickLaunch="true" InheritTopNav="true">
    <SiteGroup Action="Create" Name="{{SPWeb.Title}} Owners" Description="Test - {{SPWeb.Description}}" AllowMembersEditMembership="true" AllowRequestToJoinLeave="true" AutoAcceptRequestToJoinLeave="true" OnlyAllowMembersViewMembership="false" RequestToJoinLeaveEmailSetting="administrator@wss-server.com" Owner="WSS-SERVER\administrator" />
    <SiteGroup Action="Create" Name="{{SPWeb.Title}} Members" />
    <AssociateSiteGroup Name="{{SPWeb.Title}} Owners" Role="Owner" />
    <AssociateSiteGroup Name="{{SPWeb.Title}} Members" Role="Member" />
  </FixupWebACL>
  <FixupFiles>
    <File Path="Pages/Default.aspx">
      <WebPart Title="I need to...">
        <SetProperty Name="TasksAndToolsWebUrl" Value="{{SPWeb.ServerRelativeUrl}}" />
      </WebPart>
      <WebPart Title="[Sector Name] News">
        <UpdateTitle Set="{{SPWeb.Title}} News" />
        <SetListViewAndToolbar List="SectorNew" View="Homepage View" Toolbar="Freeform" />
      </WebPart>
    </File>
  </FixupFiles>
  <FixupLists>
    <List Title="[Sector Name] Calendar" EMailEnable="administrator">
      <UpdateTitle Set="{{SPWeb.Title}} Calendar" />
      <UpdateQuickLaunch Set="true" />
      <ListItem Type="Folder" Name="Test1">
        <FixupACL RoleAssignments="BreakClean">
          <PrincipalRole Action="Add" Name="Proposal - {{SPWeb.Title}} Owners" Type="SiteGroup" Role="Full Control" />
        </FixupACL>
      </ListItem>
      <ListItem Type="File" Name="image001.jpg">
        <FixupACL RoleAssignments="BreakClean">
          <PrincipalRole Action="Add" Name="Proposal - {{SPWeb.Title}} Owners" Type="SiteGroup" Role="Full Control" />
        </FixupACL>
      </ListItem>
      <ListItem Type="Item" ID="4">
        <FixupACL RoleAssignments="BreakClean">
          <PrincipalRole Action="Add" Name="Proposal - {{SPWeb.Title}} Owners" Type="SiteGroup" Role="Full Control" />
        </FixupACL>
      </ListItem>
    </List>
    <List Title="Documents" EnableContentTypes="true">
      <AddCTypes>
        <ContentTypeRef ID="0x01010019B10C4E56F44A46805E49D1A46F0D50" />
      </AddCTypes>
      <ReorderCTypes />
      <AddFields>
        <Field AddToDefaultView="true">
          <![CDATA[<Field Type="Rating" DisplayName="LearningNetworkRatings" Required="FALSE" Group="Learning Network Columns" ID="{ae264660-e5cf-4b16-bb87-92d6a179c4cb}" SourceID="{c441cfbf-bad8-4e7d-adfe-3b8c909fe4e4}" StaticName="LearningNetworkRatings" Name="LearningNetworkRatings" Decimals="1" Version="4" ColName="float1" RowOrdinal="0" AllowComments="TRUE"><Customization><ArrayOfProperty><Property><Name>CommentsUrl</Name></Property><Property><Name>RateUrl</Name></Property><Property><Name>AllowComments</Name><Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">true</Value></Property></ArrayOfProperty></Customization></Field>]]>
        </Field>
      </AddFields>
    </List>
  </FixupLists>
  <SetStyling SiteLogoUrl="/_layouts/IMAGES/PS_CI_Intranet/CI_Logo_Horiz.gif"></SetStyling>
  <WebFeatures>
    <Feature>
      {747755CD-D060-4663-961C-9B0CC43724E9}
    </Feature>
    <Feature>
      {F374A3CA-F4A7-11DB-827C-8DD056D89593}
    </Feature>
  </WebFeatures>
  <RestrictPageLayouts>
    <Layout>
      /_catalogs/masterPage/blankwebpartpage.aspx
    </Layout>
  </RestrictPageLayouts>
  <RestrictSiteTemplates>
    <Template LCID="1033">STS#0</Template>
    <Template>STS#1</Template>
  </RestrictSiteTemplates>
  <ProvisionWebs>
    <Web Title="Sub Web1" Description="Blah" Template="STS#0" Url="subweb1" LCID="1033" UniquePermissions="true" InheritTopNav="true" />
    <Web Title="Sub Web2" Template="STS#0">
      <Web Title="Sub Web to Sub Web2" Template="STS#0" />
    </Web>
  </ProvisionWebs>
</Provisioner>

Order of Evaluation
As a whole, the provisioner script is evaluated in the following chunks:
  1. ApplyWebTemplate
  2. ReopenWebs- Reopens an SPWeb if set to true
  3. RestoreWebProperties
  4. RestoreCss
  5. FixupWebACL
  6. FixupFiles
  7. FixupLists
  8. RestrictSiteTemplates
  9. ProvisionWebs

NOTE: Within each of the chunks, evaluation for children Elements is in the order of declaration. Any Attributes are typically evaluated before children Elements unless sepcifically noted in the spec. Not all live fields are supported.

Last edited Jun 26, 2012 at 7:41 PM by valorekhov, version 12

Comments

No comments yet.