How to: Detect the installed SKU of SharePoint with PowerShell

Do you need to know which SharePoint SKU or edition is installed on your server? Are you sure your product is not running the trial version? Do you need SharePoint 2010/2013 SKU and/or patch level information from your customer or IT department? This article provides you an easy to use PowerShell script which checks the installed products on a server and outputs the version (patch level).

You can use the Get-SPEdition PowerShell script as is. Simply run the script or use the Functions and call Get-SPEdition. Using the PowerShell scripts results in the following output.

Windows PowerShell: out Get-SPEdition

The script reads the registry to retrieve the installed versions. This information is located in below the “HKLM:software\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\InstalledProducts” path. Every GUID represents a SKU.

$products = @{ "BEED1F75-C398-4447-AEF1-E66E1F0DF91E" = "SharePoint Foundation 2010"; "1328E89E-7EC8-4F7E-809E-7E945796E511" = "Search Server Express 2010"; "B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0" = "SharePoint Server 2010 Standard Trial"; "3FDFBCC8-B3E4-4482-91FA-122C6432805C" = "SharePoint Server 2010 Standard"; "88BED06D-8C6B-4E62-AB01-546D6005FE97" = "SharePoint Server 2010 Enterprise Trial"; "D5595F62-449B-4061-B0B2-0CBAD410BB51" = "SharePoint Server 2010 Enterprise"; "BC4C1C97-9013-4033-A0DD-9DC9E6D6C887" = "Search Server 2010 Trial"; "08460AA2-A176-442C-BDCA-26928704D80B" = "Search Server 2010"; "84902853-59F6-4B20-BC7C-DE4F419FEFAD" = "Project Server 2010 Trial"; "ED21638F-97FF-4A65-AD9B-6889B93065E2" = "Project Server 2010"; "926E4E17-087B-47D1-8BD7-91A394BC6196" = "Office Web Apps 2010"; "35466B1A-B17B-4DFB-A703-F74E2A1F5F5E" = "Project Server 2013"; "BC7BAF08-4D97-462C-8411-341052402E71" = "Project Server 2013 Preview"; "C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C" = "SharePoint Server 2013"; "CBF97833-C73A-4BAF-9ED3-D47B3CFF51BE" = "SharePoint Server 2013 Preview"; "B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9" = "SharePoint Server 2013 Enterprise"; "298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0" = "SharePoint Server 2013 Enterprise Preview"; "D6B57A0D-AE69-4A3E-B031-1F993EE52EDC" = "Microsoft Office Online"; "9FF54EBC-8C12-47D7-854F-3865D4BE8118" = "SharePoint Foundation 2013" } $registryPath = "HKLM:software\Microsoft\Shared Tools\Web Server Extensions\$((Get-SPFarm).BuildVersion.Major).0\WSS\InstalledProducts" Get-RegistryKeyPropertiesAndValues -path $registryPath | ForEach-Object { Write-Host "Installed product: $($products.Get_Item($_.value)) (SKU ID: $($_.value))" } Write-Host "Installed version: $((Get-SPFarm).BuildVersion)"

With a little help from the Scripting Guy (Ed Wilson) and two MSDN articles I build the script. Enjoy!

Download: Get-SPEdition.ps1

Resources:

Merge log files when troubleshooting a multi server SharePoint farm

Even after working with SharePoint for a while you find new features. The Merge-SPLogFile cmdlet is one of them.

This cmdlet retrieves all ULS log entries from all servers in the farm and creates a one new log file. You can use the ULS viewer for further slicing and dicing the log file for more details.

Use the cmdlet with additional parameters, otherwise it could become a large operation resulting in a large file. Use like “Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -StartTime "06/09/2008 16:00" – EndTime "06/09/2008 16:15"” is very useful.

Very use full for troubleshooting! Why I’ve missed this one, I don’t know…

Developing hybrid SharePoint apps that run on-premise and in the cloud – ESPC 2014

My session at the European SharePoint Conference (#ESPC14) was around developing hybrid apps with the SharePoint App Model. Below you can find the slide deck and PowerShell scripts I used during the demo.

Before you start building hybrid apps who are depending on the authentication done by Azure Control Services (ACS) you need to setup a trust between your on-premise farm and ACS.

  1. Replace the default STS certificate and reboot machine afterwards (Replace-STSCertificate.ps1)
  2. Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW (64-bit), http://www.microsoft.com/en-us/download/details.aspx?id=41950
  3. Install Microsoft Online Services Module for Windows PowerShell (64-bit), http://go.microsoft.com/fwlink/p/?linkid=236297
  4. Run script to connect on-premise SharePoint farm to ACS (Connect-SPFarmToAAD.ps1)

Some important side notes:

  • When replacing the STS certificate, all current trusts who are depending on the STS become invalid. Meaning you have to recreate your existing Trusted Security Token Issuers (Install-TrustedSecurityTokenIssuer.ps1 & Remove-TrustedSecurityTokenIssuer.ps1)
  • Ensure you are using the RTW version of Microsoft Online Services Sign-In Assistant instead of the BETA (which is linked in the TechNet article)

Download PowerShell scripts.

Scripts originate from How to: Use an Office 365 SharePoint site to authorize provider-hosted apps on an on-premises SharePoint site (http://msdn.microsoft.com/en-us/library/office/dn155905(v=office.15).aspx), I don’t own the scripts but only provide them for easy of use.

Support for SharePoint 2010 on Windows Server 2012 + R2

When you want to run SharePoint 2010 on either Windows Server 2012 or Windows Server 2012 R2 make sure your SharePoint 2010 is at least running Service Pack 2 (SP2)!Although Hardware and software requirements (SharePoint Server 2010) does not make a note about Windows Server 2012, the KB article 2724471 does outline the support for Windows Server 2012 and Windows Server 2012 R2.

Before the release of Service Pack 2 (SP2) for Microsoft SharePoint Server 2010, Microsoft did not support SharePoint Server 2010 in a Windows Server 2012 or Windows Server 2012 R2 environment. 
However, SharePoint Server 2010 with SP2 has now been released, and this configuration is supported in Windows Server 2012 and Windows Server 2012 R2.

So, it’s supported to run SharePoint 2010 on Windows Server 2012, check out the KB article 2724471 and the description of SharePoint 2010 Service Pack 2. Enjoy all new goodies from Windows Server 2012!

[Update: SharePoint 2013 is not supported on Windows Server 2012 R2 for now. This will be supported when Service Pack 1 is released. Check KB article 2891274.]

[Update: SharePoint 2013 Service Pack 1 is released, check Announcing the release of Service Pack 1 for Office 2013 and SharePoint 2013. Resulting in SharePoint 2013 being supported on Windows Server 2012 R2]

Get disk storage for SharePoint databases

To get an indication for all database sizes in your SharePoint farm, run the following command. It shows the disk storage in bytes and MB.

image

The PowerShell script used for the output above, can be found below.

Add-PSSnapin Microsoft.SharePoint.PowerShell Get-SPDatabase | sort Name | ft Name, ` @{Name="DiskSizeRequired";Align='Right';Expression={[string]("{0:N0}" -f($_.DiskSizeRequired))}}, ` @{Name="Size(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.DiskSizeRequired/1mb))}}, ` Server -Autosize Get-SPDatabase | sort Name | select Name, DiskSizeRequired ` | measure-object -Property DiskSizeRequired -Sum -Maximum -Minimum -Average ` | ft Count, @{Name="Sum(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.Sum/1mb))}}, ` @{Name="Maximum(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.Maximum/1mb))}}, ` @{Name="Minimum(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.Minimum/1mb))}}, ` @{Name="Average(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.Average/1mb))}}

Export WSP solution packages

When WSP packages are added to a SharePoint farm they are stored in the config database. This is done to ensure new servers added to the farm can be synchronized with the specific farm configuration including WSP solution package deployment.

Because solution packages are stored in the config database, it’s possible to download/export the WSP package with PowerShell.

Get-SPSolution | ForEach-Object { $_.SolutionFile.SaveAs($_.SolutionFile.Name) }

The WSP packages are stored in the current directory.

Approaches to migrating your service applications

While working my way through TechNet documentation, I came across this very interesting table! It describes supported methods for service application migration.

The forth column shows the support for read-only database. You can find more information on read-only databases here: Run a farm that uses read-only databases (SharePoint Server 2010) [http://technet.microsoft.com/en-us/library/dd793608.aspx].

Service application

Database

Supported approach

Supports read-only

Notes

Access Services

None

not available

not available

 

Application Discovery and Load Balancing

None

not available

not available

Application Registry Service

Application Registry Service

Recreate

No

Business Data Connectivity

Business Data Connectivity

· Database attach

· Recreate

Excel Services

none

not available

not available

Microsoft SharePoint Foundation Subscription Settings

Subscription

Database attach

Managed Metadata Service

Managed Metadata Service

· Database attach

· Recreate

PerformancePoint Services

PerformancePoint Services

Recreate

PowerPoint Service

None

not available

not available

Project Server service application

· Draft

· Published

· Archive

· Reporting

Database attach

No

· Requires synchronization between the databases

· Need to configure time stamps or log marking

For more information, see Database-attach full upgrade to Project Server 2010

SharePoint Server Search

· Search Administration

· Crawl

· Property

· Recreate

· SharePoint backup and restore

No

· The index partitions are copied to the new farm and then restored on the new database server.

· The search topology is exported and then restored to the new server.

Secure Store

Secure Store

· Database attach

· Recreate

The pass phrase for the new database must be identical to the source database.

Security Token Service

Recreate

State Service

State

Recreate

No

Usage and Health Data Collection

Logging

Recreate

No

User Profile

· Profile

· Synchronization

· Social tagging

· Database attach

· Recreate

Profile requires the restoration of an encrypted FIM key

Visio Graphics Service

None

not available

not available

Web Analytics Service

· Staging

· Reporting

· Database attach

· Recreate

Word Automation Service

Word Automation Services

Recreate

not available

Word Viewing Service

None

not available

not available