Creating Site Structures On-the-Fly

SharePoint comes with many built-in templates that you can customize to match your needs. With PowerShell, you can streamline site creation for any purpose you need. You can leverage the built-in cmdlets to create and tear up site structures.

The following sample shows how PowerShell can be used to help you automate creation of a site structure. It combines the ability to list templates and create a new site. The script first lists all available site templates. (Hidden and templates designed for root sites only are not listed.) For each site in that collection, a site will be created.

Here is the sample:

image

To use the preceding code, type the following:

Create-SPMockupSites("http://portal.companyABC.com")

The script creates a blank site at http://portal.companyABC.com/Templates, and then a subsite below it for each template available.

In out-of-the-box SharePoint installation, this command creates approximately 20 new sites. Use this script when you are preparing presentations, building demo sites, or preparing educational sites for end users.

Administrators can create a similar sample when you need to create a number of sandbox sites for an upcoming educational course. All these sites could use the same template but have a different site owner.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset