How to determine the version of SharePoint using SharePoint Web Services?

I need a way to determine the version of SharePoint based on the provided URL. In addition, I need it to be implemented through SharePoint web services or any other method that does not use the SharePoint object model (since the code is not running on the server). Can anyone help? Thank you

+4
source share
3 answers

To do this, you can run a web request to your SharePoint URL and then grab the site header.

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

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 + December 15 update (KB977027) + KB977026)

12.0.0.6520 MOSS 20071 or WSS 3.0 SP2 + October 9 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 9 cumulative update (KB968850 + KB968851)

12.0.0.6421 MOSS 20071 or WSS 3.0 SP2 (KB953338 + KB953334) [Updated on August 1, 09: downloading SP2 now includes a fix (KB971620) fixes an activation problem more information about the Microsoft SharePoint team blog]

12.0.0.6341 MOSS 20071 or WSS 3.0 February 9 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 8 cumulative update (KB957691) + KB957693, KB958567 and KB958569)

12.0.0.6327 MOSS 20071 or WSS 3.0 August 08 Cumulative Update (KB956056) and KB956057)

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

12.0.0.6303 Hotfix MOSS 20071 or WSS 3.0 after SP1 (KB948945)

12.0.0.6301 Update for MOSS 20071 or WSS 3.0 after SP1 (KB941274)

12.0.0.6300 Update for MOSS 20071 or WSS 3.0 after SP1 (KB941422)

12.0.0.6219 MOSS 20071 or WSS 3.0 SP1

12.0.0.6039 MOSS 20071 or public update WSS 3.0 October

12.0.0.6036 MOSS 20071 or WSS 3.0 August 24, 2007 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.

+15
source

Here's another option (from Jeremy Thack 's blog ). Follow this link:

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

Returns, for example:

vti_encoding: SR | utf8-p

vti_extenderversion: SR | 14.0.0.7145

While technically not a web service, you can call it using http GET, analyze the results. In addition, using this method, you do not need permission to access the site collection at the URL, as with the accepted response method.

+2
source

Quickly browsing web services, I could not find a way to do this (even in admin.asmx service under the central administrator)

Ideas:

  • If you can pretend to be a System account, take the /_layouts/settings.aspx page, you will get a ProductVersionString property that you can parse html to get (consider jquery for faster results)

  • If you can change the server, create the version.aspx page in the folder 12 \ TEMPLATE \ LAYOUTS (or webservice) and through the reflective outputs like Microsoft.SharePoint.Utilities.SPUtilityInternal and ProductVersionString

0
source

Source: https://habr.com/ru/post/1302013/


All Articles