Posts tagged ‘powershell’

Activate SharePoint CmdLets in PowerShell & ISE

Activate SharePoint CmdLets in PowerShell:

Add-PSSnapin Microsoft.Sharepoint.Powershell

Permanently register the SharePoint CmdLets in your ISE profile:

if (!(test-path $profile ))
{
    new-item -type file -path $profile -force
} 
 
$cmd = 'if((Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
{
    Add-PSSnapIn "Microsoft.SharePoint.Powershell"
}'
 
out-file -FilePath $profile -InputObject $cmd -Append

via Points to Share

Activate the State Service Application

The session state service is an application service in SharePoint 2010 which is used by many components (eg Infopath Forms Service) to store temporary data accross related http requests. If you’ve used the farm configuration wizzard the state service is installed and configured automatically. Otherwise you have to activate the state service with PowerShell CmdLets.

The following snippet creates a state service application and the corresponding proxy group with the name “State Service Application” and associates them to the default proxy group:

$serviceApp = New-SPStateServiceApplication -Name "State Service Application"
New-SPStateServiceDatabase -Name "StateServiceDatabase" -ServiceApplication $serviceApp
New-SPStateServiceApplicationProxy -Name "State Service Application" -ServiceApplication $serviceApp -DefaultProxyGroup
Get-Command *spstate*

gives you a complete list of state service related CmdLets.

Enable Taxonomy Feature

If you like to use the taxonomy feature in SharePoint 2010 and try to create a Managed Metadata Column in a list or document library you may encounter the problem that this feature is not enabled by default:

At this time (Beta2 & RC) you have to activate this feature using PowerShell:

List all Features with the name *Tax*:

PS C:\> Get-SPFeature | where {$_.displayname -like "*tax*"}
 
DisplayName                    Id                                       Scope
-----------                    --                                       -----
TaxonomyFeatureStapler         415780bf-f710-4e2c-b7b0-b463c7992ef0     Farm
TaxonomyTimerJobs              48ac883d-e32e-4fd6-8499-3408add91b53     WebApplication
TaxonomyFieldAdded             73ef14b1-13a9-416b-a9b5-ececa2b0604c     Site
TaxonomyTenantAdmin            7d12c4c3-2321-42e8-8fb6-5295a849ed08     Web
TaxonomyTenantAdminStapler     8fb893d6-93ee-4763-a046-54f9e640368d     Farm

Activate “TaxonomyFieldAdded

PS C:\> Enable-SPFeature -Identity 73ef14b1-13a9-416b-a9b5-ececa2b0604c -url http://betaplace

List & Delete Sharepoint Webservice Application Pools

List all registered SharePoint application pools:

Get-SPIisWebServiceApplicationPool

Delete a specific Application Pool:

Remove-SPIisWebServiceApplicationPool -Identity "NAME"

UPDATE:
The release version has slightly different names for the cmdlets.

List all registered SharePoint application pools:

Get-SPServiceApplicationPool

Delete a specific Application Pool:

Remove-SPServiceApplicationPool -Identity "NAME"

 
For a full list take a look at MSDN.