SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can access the SharePoint-buildversion using (Get-SPFarm).buildversion in PowerShell.

I also know that by accessing /_admin/PatchStatus.aspx from central administration I can view each installed hotfix (among other things).

Is there a way to programatically check (via server object model or PowerShell) whether a given hotfix (i.e. is installed or not?

share|improve this question
up vote 1 down vote accepted

The information displayed on the Patch Status page uses a GridView control that is populated by the Microsoft.SharePoint.ApplicationPages.PatchStatusDataSourceView object in the Microsoft.SharePoint.ApplicationPages.Administration assembly (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\ADMINBIN\Microsoft.SharePoint.ApplicationPages.Administration.dll). This object is instantiated by the Microsoft.SharePoint.WebControls.AdministrationDataSourceControl object in Microsoft.SharePoint.dll.

You could use that same data source to get your data. For example:

var adminDataSourceControl = new AdministrationDataSourceControl() { ViewName = "PatchStatus" };
gridview.AutoGenerateColumns = true;
gridview.DataSource = adminDataSourceControl;

This does get the data, however the only caveat I found is that it needs to run under the Central Administration site. You could dig further to figure out what resources you need to make it load elsewhere.

share|improve this answer
John, thanks for the answer. However I was thinking more along the lines of farm.GetAllPatches() :-) Using the DataSource-Control seems to be part of the UI-Controls and I'm not sure whether they can be used in PowerShell or featureRecievers. – Nils Feb 15 '13 at 13:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.