如何用命令将Farm Solution部署到SharePoint?

公司经常会考虑在SharePoint中部署Solution来实现一些客制化的Feature,满足公司内部需求,这些Solution编写好后会build成文件,那要如何部署SolutionSharePoint Farm中呢?下面我们来看下具体的方法。

 

我们会介绍两种部署Solution的方式,分别是使用Command PromptSharePointManagement Shell实现:

  • 方法一:Command Prompt
    1. Administrator方式打开Command Prompt

Machine generated alternative text:cmd Command Prompt Pin to Start Wlndows Pin to Taskbar Open in new window Run as administrator

  1. 执行命令修改默认路径为SharePoint Bin folder "…\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN"

Machine generated alternative text:AdmlnlStrator: Command Prompt ic , . 0 s 0 f t W in do WS [ U e rs io n 6 . 3 . 9 6 øø ] ( c ) 2 øI 3 M ic ' . 0 s 0 f t Corporation. R 11 rights re s e ru e d . : XU s e rs Xadm in is t rat 0 ' . . DEMO )c d C : XPFogram F i le s 丶 Co " " 0 n S e e Ext e n S n S 丶 15 in sharedXWe F i S 丶 FO S 0 f t

  1. 执行Add Solution命令:

stsadm-o addsolution -filename"Solution filename"

Machine generated alternative text:: XPFogram F i le s 丶 Co " " 0 n F i le s 丶 " ic ' . 0 s 0 f t sharedXWeb S e ru e ' . Ext e n s io n s 丶 15 XB 丨 N )s t s a 一 0 addso ion —f "c:XSPFileConnect0F.wsp. perat ion completed succek*fully.

  1. 登录SharePoint Central Administration-> System Settings-> Manage Farm Solutions,可以看到Solution文件部署到SharePoint,但是还没有Deploy

Machine generated alternative text:Central Administration Application Management System Settlngs Momtonng Backup and Restore Security Upgrade and Migration General Application Settlngs Apps Office 3b5 Watermark Solution Management Name appssp2013watermarkmanagement.wsp Sp201 Oauditormonitor.wsp Sp201 Balternatefileaccess.wsp Sp2013connectorcontentlibrary.wsp Sp2013connectormedialibrary.wsp Sp2013documentauditing wsp Sp201 gendusergranularrestore.wsp Sp201310tusnoteslinktracking.wsp Sp2013secuntymanagement.wsp Sp2013usageactivitywebparts.wsp sp , ileconnector WSP Status Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Not Deployed Deployed № http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... N on e

  1. 执行Deploy Solution命令,部署到需要的Web Application,如果有GACPolicy等关联还需要加allow设置,这些根据需要填写;

stsadm-o deploysolution -name"solutionname" - url"web applicationurl" -immediate

Machine generated alternative text:一 0 deploysolution —name 〈 S 0 n name > —ur I 〈 u irt ua I s e ru e , . ur I > ] —a I Ic n t e n t ur Is ] —t ime ime t 0 deploy at > ] ] 一 10 c a I ] —allowgacdeploymentl —a 110 "f u I It rus t b in d I Is ] —Ic id < anguage > ] —f 0 rc e ]

 

Machine generated alternative text:: XPFogram F i le s 丶 Co " " 0 n F i le s 丶 " ic ' . 0 s 0 f t sharedXWeb S e ru e ' . Ext e n s io n s 丶 15 XB 丨 N )s t s a 一 0 deploysolution —name spfileconnector.wsp —up I http://www.product.com —a110 gacdeployment —immediate job successfully C re at e d .

  1. 此时刷新Step4Solution Management页面,显示部署成功。

Machine generated alternative text:Solution Management Name appssp2013watermarkmanagement.wsp Sp201 Oauditormonitor.wsp Sp201 Balternatefileaccess.wsp Sp2013connectorcontentlibrary.wsp Sp2013connectormedialibrary.wsp Sp2013documentauditing wsp Sp201 gendusergranularrestore.wsp Sp201310tusnoteslinktracking.wsp Sp2013secuntymanagement.wsp Sp2013usageactivitywebparts.wsp sp , ileconnector WSP Status Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed TO http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.product.com/

  • 方法二:SharePoint Management Shell
    1. Administrator方式打开SharePoint Management Shell

Machine generated alternative text:SharePoint 2m3 Manage-mepp::. Ungin from Sta P i n to taskbar U n i n 訓 Open n ew wi n d ow Run , d m i n tr 0 Open e location

  1. Add-SPSolutionSolution部署到SharePoint中:

Add-SPSolution "solution file name"

Machine generated alternative text:Admlnlstrator SharePoint 2013 Management Shell S C : S e in is t 0 pf i C n n e C t . WS p S C : S e in is t 0 . DEMO) add—spso lut ion "c S 0 lut io n 丨 d aØØf 9 9 6 e —df 3 a 一 49 6 3 . DEMO) : NS PF i le Co n n e c t ' . . Deployed 一 9 3 9 f —c 3 2 9 2 f 9 71 b" False

  1. 登录SharePoint Central Administration-> System Settings-> Manage Farm Solutions,可以看到Solution文件部署到SharePoint,但是还没有Deploy

Machine generated alternative text:Central Administration Application Management System Settlngs Momtonng Backup and Restore Security Upgrade and Migration General Application Settlngs Apps Office 3b5 Watermark Solution Management Name appssp2013watermarkmanagement.wsp Sp201 Oauditormonitor.wsp Sp201 Balternatefileaccess.wsp Sp2013connectorcontentlibrary.wsp Sp2013connectormedialibrary.wsp Sp2013documentauditing wsp Sp201 gendusergranularrestore.wsp Sp201310tusnoteslinktracking.wsp Sp2013secuntymanagement.wsp Sp2013usageactivitywebparts.wsp sp , ileconnector WSP Status Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Not Deployed Deployed № http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... http://www.custom.com/.... N on e

  1. Install-SPSolution deploy SolutionWeb Application

Install-SPSolution-Identity "solution name" -WebApplication "web applicationurl" -GACDeployment

Machine generated alternative text:S C : S e in is t 0 . DEMO > Install—SPSOIution —identity spfileconnector.wsp —webapplicat ion http://www.custom.com/ —gacdeployment S C : XU s e rs Xadm in is t rat 0 , . . DEMO >

  1. 此时刷新Step4Solution Management页面,显示部署成功。

Machine generated alternative text:Solution Management Name appssp2013watermarkmanagement.wsp Sp201 Oauditormonitor.wsp Sp201 Balternatefileaccess.wsp Sp2013connectorcontentlibrary.wsp Sp2013connectormedialibrary.wsp Sp2013documentauditing wsp Sp201 gendusergranularrestore.wsp Sp201310tusnoteslinktracking.wsp Sp2013secuntymanagement.wsp Sp2013usageactivitywebparts.wsp spfileconnector WSP Status Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed Deployed TO http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://www.custom.com/.„. http://wwv.custom.com/

 

以上就是通过Command PromptSharePoint Management Shell两种方式部署Farm SolutionSharePoint的方法,感谢阅读!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值