As part of the summary script I use the following code to get the SharePoint 2010 version. This identifies which CU or Service Pack has been installed.

There are a couple of ways for getting the build version:

1. Using Central Administration

It is of course possible to get the build version using central administration by going to ‘Central Administration –> System Settings –> Manage servers in this farm’


2. Using get-spfarm

You can use the following line of code to get the buildversion

get-spfarm | select BuildVersion


3. Using [Microsoft.SharePoint.Administration.SPFarm]::Local

This command outputs the same values as get-spfarm.



Use .tostring() to get the version as string.



  • Actually your code doesn’t work complaining about “the term get-spfarm is not recognized”.
    The right code is:

    if(!(Get-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction:SilentlyContinue))
    Add-PSSnapin Microsoft.SharePoint.Powershell

    get-spfarm | select BuildVersion

  • In some rare occasions the farm might not yet be configured (i.e. you’re just configuring it).
    Then the snapin’s version might be the way to go:
    (get-pssnapin microsoft.sharepoint.powershell).Version.Major

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.