Category Archives: PowerShell for SharePoint 2010

SharePoint 2010: Create Site Collections and Web Sites Using PowerShell

This post explains how to use PowerShell to Create Site Collections or Web sites in SharePoint 2010. Let’s start with some descriptive text: Write-Host “Welcome to site creation scripts. this script creates a site collection with 3 Projects, core and … Continue reading

Posted in PowerShell for SharePoint 2010, SharePoint 2010 | Leave a comment

SharePoint Content Types in PowerShell

The PowerShell lines below, loops through all webs within a site collection to find a content type (“SampleCT”)  that we want to get rid of. As you can see we have two nested “Foreach” loops (with two different syntaxes though): … Continue reading

Posted in PowerShell for SharePoint 2010, SharePoint 2010 | Tagged , , | Leave a comment

PowerShell to set values in the site property bag

First, let’s talk about the property  bag. Property Bags (or simply site Properties) are a way to keep some literal values so it can be access from any object within that site. For example, if a site carries some information … Continue reading

Posted in PowerShell for SharePoint 2010, SharePoint 2010 | Leave a comment

If you need to know what Sitecollections are in the content DB

  In some cases, you may have multiple sites within your site collection and it might not be something that you like. How to check if there’s any? just urn the following powershell script:   $site = Get-SPSite http://pdsosssbx08/qct/dhw $dbguid … Continue reading

Posted in PowerShell for SharePoint 2010, SharePoint 2010 | Tagged | Leave a comment

Accessing Taxonomies from PowerShell

the following code snippet assumes that a meta data store exists in “http://MySP2010/sites/CoolSites/” site collection. And also assumes that you have a group called Marketing and all Term Sets are defined under this group. In order to access the Term … Continue reading

Posted in PowerShell for SharePoint 2010 | Tagged , , | 2 Comments

A PowerShell Script to Activate a SharePoint Featuer

One simple way to activate your SharePoint 2010  features is using PowerShell. The script below, activates a feature with Id: 3eeddbe8-74ff-4266-82c8-922ca4ae1fe3 at a web site under “MyServer/Sites/” site collection   Enable-SPFeature “3eeddbe8-74ff-4266-82c8-922ca4ae1fe3” -Url http://MyServer/sites/MProject Please note that we assume the … Continue reading

Posted in PowerShell for SharePoint 2010 | Leave a comment