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>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s