PowerShell



Basic Powershell Commands for Sharepoint 2010



Find All the features deployed

Get-SPFeature | Where-Object {$_.displayname -like "WD*"}

Stop the deployment

stsadm -o canceldeployment -id <id>

Get the current Deployment id

stsadm -o enumdeployments

Add soliution

Add-SPSolution udayanewsol.wsp

Deploy solution

Install-SPSolution –Identity br.wsp –WebApplication http://br.com -GACDeployment

Uninstall solution

Uninstall-SPSolution –Identity br.wsp –WebApplication http://br.com

Remove solution

Remove-SPSolution –Identity br.wsp

Install feature

Install-SPFeature FeatureFolderName

Uninstall feature

Uninstall-SPFeature FeatureFolderName

Activate feature

Enable-SPFeature FeatureFolderName -Url http://server/site/subsite

Deactivate Feature

Disable-SPFeature FeatureFolderName -Url http://server/site/subsite

Activate site collection feature

$site = Get-SPSite http://sp2010
Enable-SPFeature -Identity “FeatureName” -Url $site.Url
$site.Dispose()

Activate site feature

$web = Get-SPWeb http://sp2010
Enable-SPFeature -Identity “FeatureName” -Url $web.Url
$web.Dispose()


Activate site collection features for all site collections in a Web Application

$webApp = Get-SPWebApplication -Identity http://sp2010
$webApp | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity “FeatureName” -Url $_.Url}

Create a State Service Application

$serviceApp = New-SPStateServiceApplication -Name “State Service Application”


New-SPStateServiceDatabase -Name “SharePoint_Service_State” -ServiceApplication $serviceApp

New-SPStateServiceApplicationProxy -Name “State Service Application Proxy” -ServiceApplication $serviceApp -DefaultProxyGroup

No comments:

Post a Comment