SharePoint發行版本有SharePoint2003、SharePoint2007、Sharepoint 2010、SharePoint2013和SharePoint2016。SharePoint提供了功能強大的團隊協作環境,使得組織能夠在整個組織內部實現整合、組織、查找和提供 SharePoint站點。 我們通常使用Visual Studio 2010來快速開發和部署我們的Sharepoint Solution.但有時我們不得不遇到要把我們開發的Solution Packages部署到其它物理位置(生產機),而不是我們開發環境所指向的服務器(測試機)。以前我們使用Stsadm工具來完成此工作,但現在我們更推薦使用PowerShell來操作。 ?? 如果要使用PowerShell,則只需要從你的目標服務器桌面的的Start菜單中找到 ? ??? 系統會自動加載Microsoft.SharePoint.PowerShell,我們便可以直接在其Command窗口中執行我們將要執行的PowerShell命令.如果對某個PowerShell命令(如Add-SPSolution)有使用上的問題,可在其Command窗口中使用Get-Help? Add-SPSolution 來取得此命令的相關幫助。 ?? 如果你是開發的Sandboxed solution,那么你需要使用Add-SPUserSolution命令來執行上面的操作。此命令需要參數–literalpath,此參數提指向Solution的全路徑, ? 如果是使用PowerShell命令,則如下 Install-SPSolution?–Identity?MySharepointProject.wsp?–WebApplication?http://myserver-sp1:2010/??-GACDeployment? 如果部署的是 Sandboxed solution,則使用Install-SPUserSolution命令。 ??????????????????????????????? SharePoint Web 應用程序的有效名稱(例如,MyOfficeApp1);或有效 SPWebApplication 對象的實例。 ?????????AllWebApplications: 指定為服務器場中的所有 SharePoint Web 應用程序部署新的 SharePoint 解決方案。 ? 如果你需要強制部署此Solution,你可以使用-Force參數。 ? 如果是使用PowerShell命令: Update-SPSolution?–Identity?MySharepointProject.wsp?–LiteralPath?D:\Sp2010\DeploySolution\MySharepointProject.wsp??–GACDeployment四、回收已經部署的Solution 我們也可使用–AllWebApplications參數來一次性從此Sharepoint Farm中的所有部署此Solution的Web Application中回收Solution. 五、移除Solution ? 上面的第四、五步如果用Stsadm來完成,則通常我們可以建立一個批處理文件eg: DeleteSolution.bat ![]() @echo?off rem?**?declare?the?solution?to?be?retracted?** set?solutionName=SampleSolution rem?**?declare?the?set?of?fetures?to?be?de-activated?** set?featureSampleFeature1=SampleFeature1 set?featureSampleFeature2=SampleFeature2 set?featureSampleFeature3=SampleFeature3 rem?**?Replace?this?value?with?the?URL?of?your?site?** @set?url=http://servername/sites/sitecollectioname/sitename @set?PATH=C:\Program?Files\Common?Files\Microsoft?Shared\web?server?extensions\12\BIN;%PATH%? echo?deactivating?features?in?solution?%solutionName%... echo?---------------------------------------------------- stsadm?-o?deactivatefeature?-name?%featureSampleFeature1%?-url?%url%?-force stsadm?-o?deactivatefeature?-name?%featureSampleFeature2%?-url?%url%?-force stsadm?-o?deactivatefeature?-name?%featureSampleFeature3%?-url?%url%?-force echo?Attempting?to?uninstallfeature?and?retract?solution echo?--------------------------------------------------- echo?Rectracting?solution?%solutionName%?from?solution?store... stsadm?-o?retractsolution???-name?%solutionName%.wsp?-immediate stsadm?-o?execadmsvcjobs? echo?Deleting?solution?%solutionName%?from?solution?store... stsadm?-o?deletesolution?-name?%solutionName%.wsp?-override? echo. if?errorlevel?==?0?goto?:success :success echo?Successfully?deployed?solution?and?activated?feature(s).. echo?. goto?end :end pause ![]() Sharepoint 可以幫助企業用戶輕松完成日常工作。 |
溫馨提示:喜歡本站的話,請收藏一下本站!