In SharePoint 2010 creating templates from sites is as simple as a few clicks. Using that template to create new site collections is a bit more involved. The standard approach goes something like this; download the newly created template, in central administration create a new site collection without specifying a template, navigate to the new site collection, when prompted for the site template upload your custom template. The problem with this approach it's too repetitive if you're going to create a lot of sites and site collections.
What I wanted to do was to select the template to create new sites and site collection just like the builtin ones. To do this you need to understand what's going on when you create a site template from the SharePoint interface. It's a solution file so we can rename it to a .cab file and take a look inside. Along with the manifest.xml file, there are folders for; ListInstances, Modules, PropertyBags, and WebTemplate. The webtemplate folder is the giveaway, what has been created for us is a definition for a webtemplate. The webtemplate folder contains a feature with a scope of "Site" that needs to be changed to a scope of "Farm".
That's it, this webtemplate can now be used to create site collections from central administration, after installation of coarse.
The steps; create the template, download the template, rename the template to .cab, extract the .cab file to a folder, modify the feature xml, convert folder back to .cab, rename to .wsp, add and deploy the solution. To convert the folder back to a cab file I used TUGZip.
Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts
Sunday, February 27, 2011
Monday, February 22, 2010
PowerShell ISE Server 2008 R2
By default PowerShell ISE is not available in Server 2008 R2. It's a feature that you will need to add. Go to Server Manager -> Features -> Add Features
PowerShell uses the "profile" concept somewhat similar to Unix. Profiles can be really useful in setting up your PowerShell session defaults. There are a number of built in profiles I was expecting to be available and was surprised when I had to create one.
How to use Profiles in Windows PowerShell ISE
How to Create Profiles in Windows PowerShell ISE
Create a new Profile
Add the SharePoint Snapin and run all my commands without annoyance. Execute the psEdit command and add the Add-PSSnapin and Set-Executionpolicy commands in the tabbed window at the top. You'll have to save the changes.
PowerShell uses the "profile" concept somewhat similar to Unix. Profiles can be really useful in setting up your PowerShell session defaults. There are a number of built in profiles I was expecting to be available and was surprised when I had to create one.
How to use Profiles in Windows PowerShell ISE
How to Create Profiles in Windows PowerShell ISE
Create a new Profile
if (!(test-path $profile.CurrentUserAllHosts))
{new-item -type file -path $profile.CurrentUserAllHosts -force}Add the SharePoint Snapin and run all my commands without annoyance. Execute the psEdit command and add the Add-PSSnapin and Set-Executionpolicy commands in the tabbed window at the top. You'll have to save the changes.
psEdit $profile.CurrentUserAllHosts
Add-PSSnapin Microsoft.SharePoint.Powershell Set-ExecutionPolicy Bypass
Labels:
PowerShell,
SharePoint 2010
Subscribe to:
Posts (Atom)



