SharePoint Conference 2012 – PowerShell 3.0 for SharePoint


I started out today with a PowerShell 3.0 Administration with SharePoint 2013 session presented by Corey Roth. This session covered what was changing within the PowerShell (PoSH) 3.0 and SharePoint environment.

Corey started off by saying that PoSH is more forgiving with SharePoint 2013 because the necessary permissions are there to be able to run commands. However still best practices to Run As Administrator when opening SharePoint Shell.

He moved onto talk about how when upgrading SharePoint Test-SPContentDatabase and Mount-SPContentDatabase are still around but they now have specific Web Application capabilities. These are crucial for the initial schema upgrade into SharePoint 2013.

Solution Management is a little different as well only because SharePoint 2013 supports solution installation into either the 14 or 15 Hives. So now the Install-SPSolution has a switch for dealing with those locations.

One of the cool features that is found with a new concept called Deferred Site Collection Upgrades is the capability of repairing sites. This maybe needed if for example a SharePoint gallery is deleted and needs to be available. Repair-SPSite will repair these necessary components so you can do your upgrade.

Within the SharePoint 2013 environment, understanding the compatibility level will be important. For example when pulling sites from SharePoint 2013 you can run this command to find out which sites are available as well as what compatibility level they are.

Get-SPSite to list sites and their compatibility level

Filter with | where-object {$_.CompatibilityLevel -eq 14}

Corey then dove into Service Applications and how to create these entities as well as the associated proxy.

There are a series of commandlets that are used when setting up Service Applications. For example Search is one of the more complicated ones because of the Topology components.

  • Get-SearchServiceInstance to get the search service
  • Start-SearchServiceInstance – to start the search service on a server
  • New-SPEnterpriseTopology – to add a new search server
  • Set-SPEnterpriseTopology – to set in place the current search service architecture

Corey also mentioned there is an updated PowerShell SharePoint 2010 script builder available on TechNet called Windows PowerShell for SharePoint Command Builder. This is specific for SharePoint and will get you moving down the PowerShell path.

Next Corey talked about the SharePoint Online commandlets to get interesting and a good starting spot to help with Administration of SharePoint Online. To kick this off you can download the SharePoint Online Management Shell. Corey warned to make sure your URL’s are https:// rather than http://. Once in that PoSH environment start by using the follow command to get what is available.

Get-Command -Module Microsoft.Online.SharePoint.PowerShell

Finally, some Tips! Use the Tab Key to take advantage of auto complete. It is very handy. Also use the –Debug syntax to step through a PoSH script. Also use the –WhatIf to test to make sure it works appropriately.

Hope this has helped.

</don>

PowerShell v2 for Administrators Course now available!


Sometimes I have to do a shameless plug for co-worker.  Lu Patrick has been very busy over the last few months completing and updated PowerShell title.  This PowerShell v2 takes somebody through what PowerShell can do in the modern OS environment.  The course includes information about installation, navigation, formatting, remote sessions, security and general knowledge about PowerShell. 

The author wrote the Learning Lake PowerShell version 1 title that was also available on the Courseware Library.  She has also been asked to speak about PowerShell v2 at the MCTSummit in the United Kingdom the later half of the this year.

For those MCT’s that are out there, check out the Courseware Library for 50414 – Microsoft Windows PowerShell v2 for Administrators published by Learning Lake.  The training is currently available at Benchmark Learning with classes on August 2nd and 17th.  Check out the website for more details.

Please spread the word!

Creating a Site Collection with PowerShell (via SPPowerShell: PowerShell for SharePoint)


I came across this excellent post on how to create SharePoint 2010 Site Collections using SharePoint by Shannon Bray. This is an excellent way to help create multi-tenant site collections in SharePoint 2010. Enjoy!

Creating a Site Collection with PowerShell Overview Once you have your web application provisioned, you will need to create a site collection with a top level site. The New-SPSite cmdlet allows you to create a new top level site with the URL and owner specified in the –URL and –OwnerAlias. You will also notice that we have the ability to configure our tenant administration. In fact, in order to configure multi-tenants, you must use PowerShell. The site templates available in SharePoint Fo … Read More

via SPPowerShell: PowerShell for SharePoint