Howto get SharePoint version using object model

旧巷老猫 提交于 2019-12-21 21:38:34

问题


With WSSv2 (SharePoint 2003) you could get the version of SharePoint you were working with

e.g. SPGloablAdmin.Version gives you "12.0.0.6219" for WSSv3 SP1

However its now obsolete (although still works).

Does anyone know the WSSv3 (SharePoint 2007) equivalent?

You have things like SPWebService.ContentService.Version but that version number is just a timestamp and doesn't seem to relate back to build versions.


回答1:


SPFarm.Local.BuildVersion would probably give you the same result without having to refer to a SPWebService.

Cheers :)




回答2:


SPWebService.ContentService.Farm.BuildVersion

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.buildversion.aspx




回答3:


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



来源:https://stackoverflow.com/questions/281718/howto-get-sharepoint-version-using-object-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!