注:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\bin html
stsadm –o addtemplate –title 鳳凰小學模版 –filename d:\fenghuangxiaoxue.stp web
MOSS部署經常使用的stsadm命令行 ide
經常使用的stsadm命令行參數有: 網站
1、installfeature、uninstallfeature:feature部署和卸載; ui
安裝feature:stsadm -o installfeature -filename [feature文件夾下]\feature.xml this
激活feature:stsadm -o activatefeature -filename [feature路徑]\feature.xml -url http://[主機標頭]:[端口]/sites/portol -force url
特別注意的地方 -url spa
還有就是:"主機標頭"能夠不是計算機名,可是有時建立Web Application時會出錯,因此仍是用計算機名比較好。也不知到爲何會出錯。 命令行
2、addwppack、deletewppack:webpart和*.cab部署和卸載; orm
安裝:stsadm -o addwppack -filename [*.cab文件路徑]\*.cab
卸載:stsadm -o deletewppack -name *.cab
通常狀況下,webpart不要直接部署到網站裏,用feature部署要好一些。
3、addtemplate、deleteremplate:template(模板)的部署和卸載;
安裝:stsadm.exe -o addtemplate -filename [*.stp文件路徑]\*.stp -title [template名稱]
4、addsolution、deletesolution:solution部署和卸載;
安裝:stsadm -o addsolution -filename [*.wsp文件路徑]\*.wsp;
部署:stsadm -o deploysolution -name *.wsp -allowgacdeployment -immediate
刪除:stsadm.exe -o deletesolution -name *.wsp
Feature功能很強大,不少東西均可以經過feature部署到MOSS裏,可是根據本身的使用狀況,我的感受母板頁(MasterPage)和模板(template)仍是經過"母板頁庫"和"模板庫"上傳上去比較好用。
5、Solution的部署與刪除:
部署:
A.把.stp 和.wsp文件直接放在c:\目錄下
打開"命令提示符"窗口,輸入:
cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
B.安裝solution
stsadm -o addsolution -filename c:\MeetingTemplate.wsp
C.部署deploysolution
stsadm -o deploysolution -name MeetingTemplate.wsp -allowgacdeployment -immediate
若是部署的是aspx頁面,DLL會自動部到GAC裏,aspx頁面也會自動部到Layouts下。
刪除
A.retractsolution
stsadm.exe -o retractsolution -name MeetingTemplate.wsp -immediate
B.deletesolution
stsadm.exe -o deletesolution -name MeetingTemplate.wsp
也能夠強制刪除 [-override]
6.激活feature
stsadm -o activatefeature -filename MeetingTemplate\feature.xml -url http://test:9001/sites/portail -force
特別注意的地方 -url
7、getlock、setlock:用於在備份backup site collection時訪問限制;
Limit access to the site collection during backup(轉載)
At a command prompt on the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.
To determine the current access level of the site, type the following command, and then press ENTER:
stsadm -o getsitelock -url <URL name>
where URL name is the URL of the site collection that you want to back up. For more information, see Getsitelock: Stsadm operation (Office SharePoint Server).
If the current access level allows changes to the site content, change it to read-only by typing the following command, and then pressing ENTER:
stsadm -o setsitelock -url <URL name> -lock readonly
where URL name is the URL of the site collection that you want to back up. For more information, see Setsitelock: Stsadm operation (Office SharePoint Server).
When the backup is complete, use this procedure to return access to the site collection to the original setting determined in step 1.
Use this procedure to back up a site collection by using the Stsadm command-line tool.
Important:
Membership in the Administrators group on the local computer is the minimum required to complete this procedure.
轉自:http://www.cnblogs.com/lmjob/archive/2010/03/01/1675564.html