PowerShell script to display version info for installed SharePoint product and language packs


In the last couple of days I have been contacted several times because customers struggled to get their system to the right patch level to allow installation of April 2015 CU to workaround the problem with the patch baseline.

To simplify this I have written a small powershell script which retrieves the version information for the patch baseline from the registry and allows to identify components which are below the re-released Service Pack 1 base line:

# PowerShell script to display SharePoint products from the registry.

Param(
  # decide on whether all the sub-components belonging to the product should be shown as well
  [switch]$ShowComponents
)

# location in registry to get info about installed software

$RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall

# Get SharePoint Products and language packs

write-host "Products and Language Packs"
write-host "-------------------------------------------"

$Programs = $RegLoc | 
	where-object { $_.PsPath -like "*\Office*" } | 
	foreach {Get-ItemProperty $_.PsPath} 
$Components = $RegLoc | 
	where-object { $_.PsPath -like "*1000-0000000FF1CE}" } | 
	foreach {Get-ItemProperty $_.PsPath} 

# output either just the info about Products and Language Packs
# or also for sub components

if ($ShowComponents.IsPresent)
{
	$Programs | foreach { 
		$_ | fl  DisplayName, DisplayVersion; 

		$productCodes = $_.ProductCodes;
		$Comp = @() + ($Components | 
			where-object { $_.PSChildName -in $productCodes } | 
			foreach {Get-ItemProperty $_.PsPath});
		$Comp | Sort-Object DisplayName | ft DisplayName, DisplayVersion -Autosize
	}
}
else
{
	$Programs | fl DisplayName, DisplayVersion
}

The output will be similar to this (the output was generated on a system on March 2015 CU):

Products and Language Packs
——————————————-

DisplayName    : Microsoft SharePoint Server 2013
DisplayVersion : 15.0.4571.1502

DisplayName    : Language Pack for SharePoint and Project Server 2013  – German/Deutsch
DisplayVersion : 15.0.4571.1502

DisplayName    : Language Pack for SharePoint and Project Server 2013  – Spanish/Español
DisplayVersion : 15.0.4571.1502

DisplayName    : Language Pack for SharePoint and Project Server 2013  – French/Français
DisplayVersion : 15.0.4569.1506

 
As you can see in the example above the French language pack is listed with the older SP1 version while the base product and the other language packs have the re-released SP1 version installed.

You can also see that the version information is for the patch baseline (SP1) and not the version of the current patch level (March 2015 CU).

Using the option -ShowComponents switch you can get more verbose information which includes the components of the installed products.

For SP2010 systems with Powershell 2.0 you can use the version below (does not support to list the components)

# PowerShell script to display SharePoint products from the registry.

# location in registry to get info about installed software

$RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall

# Get SharePoint Products and language packs

write-host "Products and Language Packs"
write-host "-------------------------------------------"

$Programs = $RegLoc | 
	where-object { $_.PsPath -like "*\Office*" } | 
	foreach {Get-ItemProperty $_.PsPath} 

# output the info about Products and Language Packs

$Programs | fl DisplayName, DisplayVersion
Comments (43)

  1. anonymouscommenter says:

    Thx for sharing!
    Can't remember I added a English Language Pack to German installation. At least I know now, that I have to do something.

    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4571.1502

    DisplayName : Language Pack for SharePoint and Project Server 2013 – English
    DisplayVersion : 15.0.4420.1017

  2. anonymouscommenter says:

    As some of you already noticed: GotDotNet is now down and the code samples previously hosted there have

  3. anonymouscommenter says:

    Thanks!

  4. anonymouscommenter says:

    Just as an FYI… This script will not work for SP 2010.

  5. Hi Joe,
    thats not correct. Just ensure that Powershell 3.0 is installed.
    The script does not run on Powershell 2.0 but it works correct with PS 3.0 on SP2010.

  6. anonymouscommenter says:

    I have not been able to test it on 3.0, but I'll take your word on it. I know you do some solid work. 🙂

  7. Hi Joe,
    above is now a stripped down version for Powershell 2.0 which lists the most important part. I removed the functionality to list the components as that logic was only compatible with Powershell 3.0.
    Cheers,
    Stefan

  8. anonymouscommenter says:

    Isn't this what roiscan does (minus all other cool features in roiscan) or did roiscan fall behind after the latest updates?

  9. Hi Piotr,
    absolutely! But in the last days I asked customers to use roiscan to check the patch baseline and in around 50% of the cases I had to help the customer to interpret the roiscan output. So I decided to create a script which provides output which is easier to
    understand in context of the April 2015 CU issue.
    Cheers,
    Stefan

  10. anonymouscommenter says:

    my output is this:

    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4569.1506

    it looks like my base product is the older version, I wasn't expecting that having used the slipstreamed version. Should I reinstall SP1 as a fix, or perhaps wait until SP2 comes out?

  11. Great script Stefan!

    I have an inventory script that is querying WMI Win32_Product is this a valid way to check the baseline version?

    Thanks,
    Ivan

  12. Hi Ivan,
    in general it is not recommended to use this as any access to this will start a reconfiguration of your system.
    See here:
    http://blogs.technet.com/b/askds/archive/2012/04/19/how-to-not-use-win32-product-in-group-policy-filtering.aspx
    Cheers,
    Stefan

  13. anonymouscommenter says:

    Buenas, En este post queríamos hacernos eco del script de PowerShell que publicó Stefan hace unos días

  14. anonymouscommenter says:

    Una vez más, y a la espera de que empiecen a aparecer las primeras noticias sobre SharePoint vNext, os

  15. anonymouscommenter says:

    This is rather perplexing me. The script ran with 15.0.4571.1502 BUT, from the Servers in Farm screen in Central Admin, the Configuration Database version is 15.0.4711.1000. Which result should I pay attention to? Both ?

  16. Hi Bismarck,

    the script shows the patch basedline.
    The Servers in Farms screen shows the config db schema.
    These are unrelated things.
    Btw: the config database schema version does not provide reliable info on the patch level of your farm in case you are looking for this:
    http://blogs.technet.com/b/stefan_gossner/archive/2014/10/23/common-question-why-does-the-version-number-on-the-quot-servers-in-farm-quot-page-not-change-after-installing-october-cu.aspx

    Cheers,
    Stefan

  17. anonymouscommenter says:

    A couple of customers already ran into this issue: if you created your farm based on the SharePoint 2013

  18. anonymouscommenter says:

    Following my tradition in presenting a summarized "Build Numbers Cube Sheet" as I did so before

  19. anonymouscommenter says:

    SharePoint 2010 Build Numbers Cube Sheet
    As many times used in our daily business, we’re used

  20. anonymouscommenter says:

    Useful information, thanks!

  21. anonymouscommenter says:

    Thanks!

  22. anonymouscommenter says:

    I’m presenting a summarized "Build Numbers Cube Sheet" as I did so before, so please find

  23. anonymouscommenter says:

    I’m presenting a summarized "Build Numbers Cube Sheet" as I did so before, so please find

  24. anonymouscommenter says:

    SharePoint 2010 Build Numbers Cube Sheet
    As many times used in our daily business, we’re used

  25. anonymouscommenter says:

    I've recently installed June 2015 CU on SharePoint 2010 server, but when I run this script it shows 14.0.7015.1000 which means sp2.

  26. Hi Me,
    that is expected. The script shows the patch baseline, not the patch level.
    Cheers,
    Stefan

  27. anonymouscommenter says:

    Hi,
    I have recently installer the March 2015 CU, but since I am not able to install any other CU on my servers…
    I got the message : "The expected version of the product was not found on the system".

    Here is the version number I get from your script :

    Products and Language Packs
    ——————————————-

    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4571.1502

    DisplayName : Language Pack for SharePoint and Project Server 2013 –
    English
    DisplayVersion : 15.0.4420.1017

    Any any to fix that?

    I have tried this :
    – bypadd update with PACKAGE.BYPASS…=1
    – install april CU
    – install may CU
    – etc.

    I get the message every time I try to install an update… very disappointing :/

    Thanks for your help!

    Xavier.
    French Developer.

  28. Hi Xavier,
    as you can see from the baseline version numbers in your output the english language pack is on RTM level. That means SP1 for the english language pack has never been installed. The result is that your system is currently in an unsupported state.

    You have to install SP1 for the english language pack – afterwards you will be able to install more current CUs.
    Cheers,
    Stefan

  29. anonymouscommenter says:

    Hi,

    I have successfully installed the June CU, with the bypass command today !
    It seems that the bypass command has worked with this CU.

    The product and language pack are the same than before, but I got the righ build number on my spfarm, perfectly matching the build number of the June CU :

    PS C:Usersadministrateur.******> (get-spfarm).buildversion

    Major Minor Build Revision
    —– —– —– ——–
    15 0 4727 1000

    But you are right, this is an unstable state :/ …

    Where can I get the english language pack?
    By reading another article from you, I though that the language pack was present inside the CU.

    Best regards.

    Xavier.
    French Developer.

  30. Hi Xavier,
    the language pack is included in the CU – but not SP1 for the language pack.
    You have to install SP1 for the base product and also for each installed language pack.
    Thats what you missed.
    SP1 for our language packs can be downloaded from here:
    http://www.microsoft.com/en-us/download/details.aspx?id=42543

    Btw: you messed up your system completely. The bypass parameter is an undocumented feature which should only be used if advised by Microsoft support.
    Using this parameter you can install a CU on a base product which is not on the right service pack level. Means the files in the fix do not patch the installed product.
    That means interfaces can be broken. Parameters passed to functions between base product and patch can be different.
    Result can be database inconsistencies, Exceptions and lots of other things.

    Usually we ask our customer to reinstall the system if they are running a system in such an inconsistent state.

    Best Regards,
    Stefan

  31. anonymouscommenter says:

    Hi,

    Thanks for your response.
    For now, the system seems to be very very stable.

    The june patch also fixed the broken redirection from the february patch :
    http://www.toddklindt.com/blog/Regressions/sp2013feb2015cu.aspx

    The central administration is working fine. I got integrity errors about low storage, application pool, and no critical errors.

    But… I take your response very serious and if I encounter any abnormal problems, I will explained them in that topic. I will check the language pack link too.

    Thanks a lot for your disponibility.
    Best regards.

    Xavier.
    Web developer.

  32. anonymouscommenter says:

    I’m presenting a summarized "Build Numbers Cube Sheet" as I did so before, so please find

  33. anonymouscommenter says:

    SharePoint 2010 Build Numbers Cube Sheet
    As many times used in our daily business, we’re used

  34. anonymouscommenter says:

    I’m presenting a summarized "Build Numbers Cube Sheet" as I did so before, so please find

  35. Johish says:

    Thanks for this usefull script Stefan.

    When I run this script gives me half of text, for example:

    DisplayName DisplayVersion
    ———– ————-
    Microsoft Access Services Server 15.0.4571….

    How can I get full text in the output?

    Thanks!

    1. Easiest way is to configure the powershell windows to show more columns.

  36. Rajni says:

    Hi,

    I have installed this SP1 (officeserversp2013-kb2880552-fullfile-x64-en-us.exe) and ran into multiple issue.

    in central admin i can see the upgrade status as “15.0.4571.1502” and i see the same version in control panel.

    but when i check the upgrade status in Central Admin under Upgrade and Migration > Check Upgrade Status.

    I see the Status as FAILED with 2 error and when i checking the log i dont see any errors listed there.

    Please help on this.

  37. I just ran these on my QA and Production and Dev servers, THANK YOU! I see some are not SP1 Mark 2! I wanted to offer a little spelling error I saw in the output as an FYI. I copied the script and ran it as admin in SharePoint 2013 Management Shell – DisplayName : Microsoftr

    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4569.1506

    DisplayName : Microsoftr Project Server 2013
    DisplayVersion : 15.0.4571.1502

    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4569.1506

    DisplayName : Microsoftr Project Server 2013
    DisplayVersion : 15.0.4569.1506

    Thank you again for your posting, it is extremely helpful and valuable! I appreciate your blog posts and the information you provide!

  38. Mark says:

    Hi,
    By running your script my farm return:
    DisplayName : Microsoft SharePoint Server 2013
    DisplayVersion : 15.0.4569.1506

    However in the CA page http:///_admin/FarmServers.aspx
    the Configuration database version: 15.0.4763.1000

    Recently we have patched the server by download the patch and install (not install via CU). Is the version different sounds bad? Can I fix it?

    1. Hi Mark,

      15.0.4569.1506 is the patch baseline and 15.0.4763.1000 is the patch level.
      The patch baseline of your SharePoint server is on original SP1 level.
      It is expected that these are different as only Service Pack installs change the patch baseline.

      Cheers,
      Stefan

      1. Niranjan Kulkarni says:

        OKay I only want to show the sharepoint server name and not the coressponding server names, what should I change in the implementation,

        For eg- I want to show,

        DisplayName : Microsoft SharePoint Server 2013
        DisplayVersion : 15.0.4571.1502

        And not the,

        DisplayName : Microsoft SharePoint Server 2013
        DisplayVersion : 15.0.4571.1502

        DisplayName : Microsoft Office Professional Plus 2013
        DisplayVersion : 15.0.4420.1017

        DisplayName : Microsoft SharePoint Designer 2013
        DisplayVersion : 15.0.4420.1017

        DisplayName : Microsoft Visio Professional 2013
        DisplayVersion : 15.0.4420.1017

        1. you would need to adjust the comparison in this line:
          where-object { $_.PsPath -like “*\Office*” }
          to reflect the products you would like to show.
          e.g. for SharePoint 2016 *\Office16.OSERVER

          Check the registry to locate the entries you are intersted in.

  39. Hank says:

    Can the last script be modified to search a remote server’s registry?

Skip to main content