[英]Identify SharePoint Foundation or SharePoint 2010
我在虛擬機中安裝了SharePoint。 如何查找是SharePoint Foundation還是SharePoint 2010? 我運行了此命令-
Get-SPFarm | Select BuildVersion
它給我的構建版本為14.0.4762.1000。 如何從中識別版本?
好吧,應該再搜索一段時間。 我在這里找到它-https: //sharepoint.stackexchange.com/questions/3886/how-to-detect-the-edition-of-sharepoint-2010-installed 。 我們可以驗證一個regedit密鑰,以識別與SharePoint版本匹配的GUID。
MSDN上有一個頁面http://msdn.microsoft.com/zh-cn/library/ff721969.aspx,該頁面使用注冊表訪問來列出已安裝的SharePoint產品。 但是,有時您沒有足夠的權限查看注冊表,或者您只想使用SharePoint API-不依賴於注冊表路徑。 (您可能需要在與SharePoint解決方案一起部署的某些代碼中進行此檢查,而注冊表訪問可能是不必要的要求。)
上面指向stackexchange的 鏈接還指出了在PowerShell中使用SPFarm.Products屬性的一種方法。 這將是檢查C#中SharePoint Server版本的完整代碼:
// B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0 : SharePoint Server 2010 Standard Trial
// 3FDFBCC8-B3E4-4482-91FA-122C6432805C : SharePoint Server 2010 Standard
// 88BED06D-8C6B-4E62-AB01-546D6005FE97 : SharePoint Server 2010 Enterprise Trial
// D5595F62-449B-4061-B0B2-0CBAD410BB51 : SharePoint Server 2010 Enterprise
Guid[] serverGuids = { new Guid("B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0"),
new Guid("3FDFBCC8-B3E4-4482-91FA-122C6432805C"),
new Guid("88BED06D-8C6B-4E62-AB01-546D6005FE97"),
new Guid("D5595F62-449B-4061-B0B2-0CBAD410BB51") };
// If a Server ID cannot be detected we are running on Foundation.
bool isServer = SPFarm.Local.Products.Any(productGuid =>
serverGuids.Contains(productGuid));
-費爾達
對於基於SharePoint 2013的客戶項目,我們遇到了同樣的問題。 對於這種情況,我們開發了一個簡單的Helper,可以輕松地將其用於SharePoint2010。有關該Helper及其使用方法的更多信息,請參見:
http://msscorner.de/2014/06/11/identify-which-sharepoint-2013-edition-is-in-use/
如果要將此幫助程序用於SharePoint 2010,則只需更改上面列出的帶有SharePoint 2010 SKU的SharePoint 2013 SKU。
我希望這能幫到您!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.