Here this article you can see list commands which is useful for deploying the web part in Farm Level ,Web Application leve or site collection level.In Sharepoint 2010 l you can run below commands on SharePoint 2010 Management Power Shell.
Step 1 : Open SharePoint 2010 Management Shell
1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
2.On the Start menu, click All Programs.
3. Click Microsoft SharePoint 2010 Products.
4.Click SharePoint 2010 Management Shell.
5. At the Windows PowerShell command prompt, type the following command:
// Add Solution to SharePoint 2010 Central Administration
Step 2 : Add-SPSolution -LiteralPath
e.g Add-SPSolution -LiteralPath C:\TestWebPart.wsp
//Install Solution @ Web Application
Step 3 : Install-SPSolution -Identity-WebApplication
e.g. Install-SPSolution -Identity "TestWebPart.wsp" -webapplication "http://sitename"-GACDEployment
//Activate Site Collection Feature @ Web Application
Step 4 : Enable-SPFeature -Identity-URL http://url
e.g. Enable-SPFeature -Identity ba5bc6d0-d2d9-4032-8334-7767aabb2414 -url http://sitename
Enable-SPFeature -Identity TestWebPart_Feature1 -url http://sitename
Step 5 : On Completion of Step 3 , 4 and 5 your web part will be deploy on Web application and also feature is activate.
Same Way Remove Web Part from Web Application and Farm Level
-- Disable Feature from Web Application
Disable-SPFeature -Identity TestWebPart_Feature1 -url http://sitename
-- Remove Web Part from Web Application
Uninstall-SPSolution –Identity TestWebPart.wsp –WebApplication http://sitename
Remove-SPSolution–Identity TestWebPart.wsp
-- Remove Solution from Central Administration
Remove-SPSolution "TestWebPart.wsp"
-- Uninstall Feature from Site Collection
Uninstall-SPFeature FeatureFolderName
--To Update Existing web part
Update-SPSolution –Identity TestWebPart.wsp –LiteralPath “C:\TestWebPart.wsp” –GacDeployment
Listing Features on Farm,SiteCollection
--To see all features for a Web Application:
Get-SPFeature -WebApplication http://webapplicationName
--To see all features for a Site Collection:
Get-SPFeature -Site http://sitecollection
--To see all features for a Site:
Get-SPFeature -Web http://siteurl
If Share Point solutions do not retract or do no Deploying then Please use below Commands for survive
//Remove Solution from All Web Application
Uninstall-SPSolution -identity TestWebPart.wsp -allwebapplications
//Remove Solution from Central Administration using Force Command
remove-spsolution -identity {name of wsp file.wsp} -force
//Again Add Solution
add-spsolution -literalpath C:\{FULL file system location\name of wsp file.wsp}
//Install Solution using Force Command
install-spsolution -identity TestWebPart.wsp -webapplication http://Siteurl -GACDeployment -force
References :
http://www.sharepointanalysthq.com/2010/09/sharepoint-2010-powershell-feature-cmdlets-2/
http://patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/12/02/adding-and-deploying-solutions-with-powershell-in-sharepoint-2010.aspx
=================================
Add Web Part to Central Administration And Web Application Level
Step 1 : Open SharePoint 2010 Management Shell
1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
2.On the Start menu, click All Programs.
3. Click Microsoft SharePoint 2010 Products.
4.Click SharePoint 2010 Management Shell.
5. At the Windows PowerShell command prompt, type the following command:
// Add Solution to SharePoint 2010 Central Administration
Step 2 : Add-SPSolution -LiteralPath
e.g Add-SPSolution -LiteralPath C:\TestWebPart.wsp
//Install Solution @ Web Application
Step 3 : Install-SPSolution -Identity
e.g. Install-SPSolution -Identity "TestWebPart.wsp" -webapplication "http://sitename"-GACDEployment
//Activate Site Collection Feature @ Web Application
Step 4 : Enable-SPFeature -Identity
e.g. Enable-SPFeature -Identity ba5bc6d0-d2d9-4032-8334-7767aabb2414 -url http://sitename
Enable-SPFeature -Identity TestWebPart_Feature1 -url http://sitename
Step 5 : On Completion of Step 3 , 4 and 5 your web part will be deploy on Web application and also feature is activate.
Same Way Remove Web Part from Web Application and Farm Level
-- Disable Feature from Web Application
Disable-SPFeature -Identity TestWebPart_Feature1 -url http://sitename
-- Remove Web Part from Web Application
Uninstall-SPSolution –Identity TestWebPart.wsp –WebApplication http://sitename
Remove-SPSolution–Identity TestWebPart.wsp
-- Remove Solution from Central Administration
Remove-SPSolution "TestWebPart.wsp"
--To Update Existing web part
Update-SPSolution –Identity TestWebPart.wsp –LiteralPath “C:\TestWebPart.wsp” –GacDeployment
Listing Features on Farm,SiteCollection
--To see all features for a Web Application:
Get-SPFeature -WebApplication http://webapplicationName
--To see all features for a Site Collection:
Get-SPFeature -Site http://sitecollection
--To see all features for a Site:
Get-SPFeature -Web http://siteurl
If Share Point solutions do not retract or do no Deploying then Please use below Commands for survive
//Remove Solution from All Web Application
Uninstall-SPSolution -identity TestWebPart.wsp -allwebapplications
//Remove Solution from Central Administration using Force Command
remove-spsolution -identity {name of wsp file.wsp} -force
//Again Add Solution
add-spsolution -literalpath C:\{FULL file system location\name of wsp file.wsp}
//Install Solution using Force Command
install-spsolution -identity TestWebPart.wsp -webapplication http://Siteurl -GACDeployment -force
References :
http://www.sharepointanalysthq.com/2010/09/sharepoint-2010-powershell-feature-cmdlets-2/
http://patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/12/02/adding-and-deploying-solutions-with-powershell-in-sharepoint-2010.aspx
Deploying the Web Part using STSADM
The great thing about creating a WSP file is that you can now use the stsadm command line to deploy your SharePoint Feature. In this case, my Feature is a web part. I personally believe that if you cannot deploy a complete solution using a SharePoint Feature, you should reconsider your deployment approach. Deployment into your production environments should be a controlled, repeatable and automated.
The following commands need to be run to deploy the solution to SharePoint.
stsadm.exe -o addsolution -filename C:\WSSDistillery\Deploy\WSSDistillery.Deploy\WSSDistillery.Deploy.WebPart.wsp
stsadm.exe -o deploysolution -name WSSDistillery.Deploy.WebPart.wsp -url http://mossserver:28921 -immediate -force
stsadm.exe -o execadmsvcjobs
Note that the URL to the web application is specified in the deploysolution command. The is necessary because the Feature.xml is a scope of Site.
No comments:
Post a Comment