Boris
Boris

Reputation: 10234

How to determine SharePoint version using SharePoint web services?

I need a way to determine the version of SharePoint based on the URL provided. Also, I need to have it implemented through SharePoint web services or any other method that does not involve SharePoint's object model (because the code is not executed on the server). Could anyone help please? Thanks.

Upvotes: 4

Views: 21652

Answers (3)

Eccentropy
Eccentropy

Reputation: 474

Here's another option (from Jeremy Thake's blog). Browse to:

http://<servername>/_vti_pvt/service.cnf

Returns, for example:

vti_encoding:SR|utf8-nl

vti_extenderversion:SR|14.0.0.7145

While not technically a web serivce, you could call it using an http GET, parse the results. Additionally, with this method, you don't need permission to access the site collection at the URL, as you do with the accepted answer's method.

Upvotes: 2

Joshua
Joshua

Reputation: 905

To achieve this you can execute a web request to your SharePoint URL and then capture a host header.

There is a host header called MicrosoftSharePointTeamServices that will provide you with the SharePoint version.

See below:

using System;
using System.Net;

class C {
  static void Main(string[] args) {
    var uri = new Uri(args[0]);
    var wc = new WebClient();
    wc.UseDefaultCredentials = true;
    wc.DownloadString(uri);
    var sharePointVersion = wc.ResponseHeaders["MicrosoftSharePointTeamServices"];
    Console.WriteLine(sharePointVersion);
  }
}

Then compare your SharePointVersion with the following list:

12.0.0.6535 MOSS 20071 or WSS 3.0 SP2 + December 09 cumulative Update (KB960010 + KB960011)

12.0.0.6524 MOSS 20071 or WSS 3.0 SP2 + 15th December Update (KB977027 + KB977026)

12.0.0.6520 MOSS 20071 or WSS 3.0 SP2 + October 09 cumulative Update (KB974989 + KB974988)

12.0.0.6514 MOSS 20071 or WSS 3.0 SP2 + August 09 cumulative Update (KB973400 + KB973399)

12.0.0.6510 MOSS 20071 or WSS 3.0 SP2 + June 09 cumulative Update (KB971538 + KB971537)

12.0.0.6504 MOSS 20071 or WSS 3.0 SP2 + April 09 cumulative Update (KB968850 + KB968851)

12.0.0.6421 MOSS 20071 or WSS 3.0 SP2 (KB953338 + KB953334) [Updated 1st Aug 09: SP2 download now includes the hotfix (KB971620) that corrects the activation issue more information on the Microsoft SharePoint team blog]

12.0.0.6341 MOSS 20071 or WSS 3.0 February 09 cumulative Update (KB961755 + KB961756)

12.0.0.6335 MOSS 20071 or WSS 3.0 December 08 cumulative Update (KB960010 + KB960011)

12.0.0.6331 MOSS 20071 or WSS 3.0 October 08 cumulative Update (KB957691 + KB957693,KB958567 and KB958569)

12.0.0.6327 MOSS 20071 or WSS 3.0 August 08 cumulative update (KB956056 & KB956057)

12.0.0.6318 MOSS 20071 or WSS 3.0 Infrastructure Update (KB951695 & KB951297)

12.0.0.6303 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB948945)

12.0.0.6301 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB941274)

12.0.0.6300 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB941422)

12.0.0.6219 MOSS 20071 or WSS 3.0 SP1

12.0.0.6039 MOSS 20071 or WSS 3.0 October public update

12.0.0.6036 MOSS 20071 or WSS 3.0 August 24, 07 hotfix package

12.0.0.4518 MOSS 20071 or WSS 3.0 RTM

12.0.0.4407 MOSS 20071 or WSS 3.0 Beta 2 TR

12.0.0.4017 MOSS 20071 or WSS 3.0 Beta 2

12.0.0.3111 Office 12 (PDC image - pre-beta) - This version of Office does not have a support link in the Add/Remove programs dialog box.

Upvotes: 15

Francisco Aquino
Francisco Aquino

Reputation: 9117

Quickly browsing the webservices I couldn't find a way to do that (even in the admin.asmx service under the central admin)

Ideas:

  1. If able to impersonate as the System Account, grab the /_layouts/settings.aspx page, theres a ProductVersionString property that you can parse the html to get to (consider jquery for faster results)

  2. If able to change the server, create version.aspx page in the 12\TEMPLATE\LAYOUTS folder (or webservice) and via reflection outputs the Microsoft.SharePoint.Utilities.SPUtilityInternal type and its ProductVersionString

Upvotes: 0

Related Questions