SharePoint發(fā)行版本有SharePoint2003、SharePoint2007、Sharepoint 2010、SharePoint2013和SharePoint2016。SharePoint提供了功能強(qiáng)大的團(tuán)隊(duì)協(xié)作環(huán)境,使得組織能夠在整個(gè)組織內(nèi)部實(shí)現(xiàn)整合、組織、查找和提供 SharePoint站點(diǎn)。 我們通常使用Visual Studio 2010來快速開發(fā)和部署我們的Sharepoint Solution.但有時(shí)我們不得不遇到要把我們開發(fā)的Solution Packages部署到其它物理位置(生產(chǎn)機(jī)),而不是我們開發(fā)環(huán)境所指向的服務(wù)器(測(cè)試機(jī))。以前我們使用Stsadm工具來完成此工作,但現(xiàn)在我們更推薦使用PowerShell來操作。 ?? 如果要使用PowerShell,則只需要從你的目標(biāo)服務(wù)器桌面的的Start菜單中找到 ? ??? 系統(tǒng)會(huì)自動(dòng)加載Microsoft.SharePoint.PowerShell,我們便可以直接在其Command窗口中執(zhí)行我們將要執(zhí)行的PowerShell命令.如果對(duì)某個(gè)PowerShell命令(如Add-SPSolution)有使用上的問題,可在其Command窗口中使用Get-Help? Add-SPSolution 來取得此命令的相關(guān)幫助。 ?? 如果你是開發(fā)的Sandboxed solution,那么你需要使用Add-SPUserSolution命令來執(zhí)行上面的操作。此命令需要參數(shù)–literalpath,此參數(shù)提指向Solution的全路徑, ? 如果是使用PowerShell命令,則如下 Install-SPSolution?–Identity?MySharepointProject.wsp?–WebApplication?http://myserver-sp1:2010/??-GACDeployment? 如果部署的是 Sandboxed solution,則使用Install-SPUserSolution命令。 ??????????????????????????????? SharePoint Web 應(yīng)用程序的有效名稱(例如,MyOfficeApp1);或有效 SPWebApplication 對(duì)象的實(shí)例。 ?????????AllWebApplications: 指定為服務(wù)器場(chǎng)中的所有 SharePoint Web 應(yīng)用程序部署新的 SharePoint 解決方案。 ? 如果你需要強(qiáng)制部署此Solution,你可以使用-Force參數(shù)。 ? 如果是使用PowerShell命令: Update-SPSolution?–Identity?MySharepointProject.wsp?–LiteralPath?D:\Sp2010\DeploySolution\MySharepointProject.wsp??–GACDeployment四、回收已經(jīng)部署的Solution 我們也可使用–AllWebApplications參數(shù)來一次性從此Sharepoint Farm中的所有部署此Solution的Web Application中回收Solution. 五、移除Solution ? 上面的第四、五步如果用Stsadm來完成,則通常我們可以建立一個(gè)批處理文件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 可以幫助企業(yè)用戶輕松完成日常工作。 |
溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!