Creating a Site Collection with Power Shell

Building a SharePoint Farm involves several steps to make sure the site will be utilized by the business users. Governance takes a big part on the design of the Sites(s)

Depending of the size of your farm is conceivable that you will need more than one site colleciton to allocate your business data and to keep security permissions isolated among all the business units. here is where creating programatically all your site collections becomes handy, specially when you don’t have to repeat your self and like to things move agile at all times.

The Following code will be able to create a Database to be used by this site collection, Create a site collection that store the data in the recently created database assign as site collection administratror a specific account, in this case the Farm Admin or the Sharepoint Admin account, with the Template Team Site. Finally run a custom permission level script to be used in this Site Collection and as part of the global compliance security policy of the Farm.

The Site uses the existing Custom Permissions Levels to create 3 Customized named security groups using those permission levels and assign the role to it. also add the authenticated users to the domain with the default My Viewer permission.

Now we are ready to start using our HR Site Collection with the assurance of 1 Database for the content of this site, with the correct template to be used and with the correct permission levels.

The only thing left to do is to verify the default created permission levels and leave the custom take lead on the permissions not only for this site, but also to all the subsites created underneath their url.

Clicking on Site Settings, Site Permission. The Custom Created Security Groups using also the Custom Created Permission Levels should be.