How to get the version of SharePoint using the object model

With WSSv2 (SharePoint 2003), you can get the version of SharePoint that you worked with

eg. SPGloablAdmin.Version gives you "12.0.0.6219" for WSSv3 SP1

However, its now obsolete (although it works).

Does anyone know the equivalent of WSSv3 (SharePoint 2007)?

You have things like SPWebService.ContentService.Version , but this version number is just a timestamp and does not seem to apply to version building.

+2
source share
3 answers

SPFarm.Local.BuildVersion will probably give you the same result without accessing the SPWebService.

:)

+4

As maxim said, but I included it in the Powershell script http://snipt.org/nLS/

+1
source

All Articles