During today’s SharePoint 2010 Ignite training, it was apparent that Microsoft is now turning to Windows PowerShell as the primary command line tool for interaction with SharePoint. 

I learned about many of the advantages that are obtained by utilizing the SharePoint 2010 Management Shell to script administrative tasks in SharePoint Server 2010. Windows PowerShell cmdlets go far beyond the capabilities of previous command-line tools such as STSADM.  Windows PowerShell is not a replacement for STSADM, but it certainly seems to be more flexible and powerful.

The Hands-On labs gave me a test drive into the following areas:

  • How to use Windows PowerShell scripting techniques, such as pipes, filters, wildcards, and enumerations, for SharePoint Server 2010 administration.

  • How to assign variables and use the SharePoint object model from Windows PowerShell.

The ability to use wildcards can be particularly useful when you combine cmdlets.  For example, suppose you want to provision a team blog site on every site collection on the http://abc.domain.com/sites/ managed path.  First you would enumerate through each site collection on the path and then create the new blog site under each one.

 The PowerShell code would look as follows:

 PS C:\Users\Administrator> Get-SPSite http://abc.domain.com/sites/* -Limit All | foreach{New-SPWeb –Url ($_.Url + "/blog") –Template BLOG#0} 

 And now it's done!  The “power” of Windows PowerShell is really starting to sink in.