Introduction

In this article, we will show how to detect the current installed SharePoint 2016 Edition and the Farm Build Number via PowerShell.


Prerequisites

Before you run this script, you should make sure that the current user has sufficient privilege to run a PowerShell script in SharePoint. Read more at Add-SPShellAdmin.

Note: You can directly use the farm account to run this script.


Script Functions

This script has a simple function called Get-SP2016Edition

function Get-SP2016Edition()
 {
   $SharePointEditionGuid = (Get-SPFarm).Products
   $SharePointEdition = switch ($SharePointEditionGuid)
    {
        5DB351B8-C548-4C3C-BFD1-82308C9A519B {"The Installed SharePoint Edition is SharePoint 2016 Trail Edition."; Break}
     4F593424-7178-467A-B612-D02D85C56940 {"The Installed SharePoint Edition is SharePoint 2016 Standard Edition."; Break}
        716578D2-2029-4FF2-8053-637391A7E683 {"The Installed SharePoint Edition is SharePoint 2016 Enterprise Edition."; Break}
    }
   
   if($SharePointEdition -eq $null)
    {
      Write-Host "The SharePoint Edition can't be determined." -ForegroundColor Red
    }
  else
    {
      Write-Host $SharePointEdition -ForegroundColor Yellow
      Write-Host "The Build Version:" (Get-SPFarm).buildversion -ForegroundColor Yellow
    }
 }

The Get-SP2016Edition detect the SharePoint Edition based on the SKUID. In case, it's

  • 5DB351B8-C548-4C3C-BFD1-82308C9A519B, So The Installed SharePoint Edition is SharePoint 2016 Trail.
  • 4F593424-7178-467A-B612-D02D85C56940, So The Installed SharePoint Edition is SharePoint 2016 Standard.
  • 716578D2-2029-4FF2-8053-637391A7E683, So The Installed SharePoint Edition is SharePoint 2016 Enterprise.
It also detects the current farm build number via (Get-SPFarm).buildversion cmdlet.


How to Use the Script



Script Output

This script has been tested on multiple SharePoint 2016 farms and showed good and accurate results. 

(Test1) You have SharePoint 2016, The script will work properly and get the current SharePoint Edition and the farm build number as shown below:

 

(Test2) You don't have SharePoint 2016, The script will inform you "The SharePoint Edition can't be determined" as shown below:



Note: There is no SharePoint Foundation for SharePoint 2016, check the alternatives at SharePoint 2016 Foundation, What's the alternative?


Applies To

  • SharePoint 2016.

Download

Download the script file "Detect_the_Installed_Edition_of_SharePoint_2016.ps1" from TechNet Gallery.

Conclusion

In this article, we have explained How to detect the current installed SharePoint 2016 Edition and the Farm Build Number via PowerShell.

See Also

Back to Top