Managing deployments through Windows PowerShell is a
new concept in SharePoint 2010. PowerShell is a scripting utility meant
to enable server administrators to automate a wide range of
administrative tasks. There are a number of different commands you can
use to manage deployments in this way. For example, you can create,
modify, and delete web applications and site collections through
PowerShell and commandlets (cmdlets). You can also start and stop
services or grant permissions through cmdlets.
STSADM, the
command-line tool for managing SharePoint, is still included in
SharePoint 2010 and retains SharePoint 2007 functionality. However,
STSADM is being phased out, which means that none of the new SharePoint
2010 functions can be accessed by STSADM. However, all functions that
are new to SharePoint 2010 are available through PowerShell. Because PPS
is a new addition to SharePoint 2010, no supported features are
available to manage PPS through STSADM.
Tip
Keep in mind that that STSADM
may not be included in the next version of SharePoint. If you use or
are developing solutions with STSADM, best practice is to switch over
now to avoid future incompatibility problems.
Launching PowerShell
PowerShell can be launched
using the Start menu on any server machine in the farm. It is located
under the Microsoft SharePoint 2010 Products folder and is named
SharePoint 2010 Management Shell. Launching from this location
automatically loads SharePoint PowerShell objects and cmdlets.
If you create a script that
is intended to run without the need to launch PowerShell from the
SharePoint folder on the Start menu, this command loads all required
SharePoint objects into the current PowerShell window or script:
Add-PsSnapin Microsoft.SharePoint.PowerShell
Cmdlet Reference
PPS cmdlets
are the command-line style mechanism available to query information or
to modify settings on various PPS system-level objects. PPS cmdlets are
designed to integrate with the SharePoint cmdlet functionality. Cmdlets
are divided into nouns and verbs. Nouns are types of objects to interact
with, whereas verbs describe how to interact with types of objects. In
addition, parameters are available for most objects depending on how you
want to interact with an object. Nouns, verbs, and parameters are
always combined in the following syntax:
Verb-Noun -ParameterName1 ParameterValue1 -ParameterName2 ParameterValue2
These are the generally available verbs that can be used when working with PPS objects:
These are the nouns that are implemented by PPS:
SPPerformancePointServiceApplication
SPPerformancePointServiceApplicationProxy
SPPerformancePointServiceApplicationTrustedLocation
SPPerformancePointSecureDataValues
Note
The SPPerformancePointServiceApplication and SPPerformancePointServiceApplicationProxy
cmdlets do not have a Remove verb. This verb is covered by the
SharePoint standard service application and application proxy removal
cmdlets of Remove-SPServiceApplication and Remove-SPServiceApplicationProxy.
For example, to create a new service application, you would call the New verb with the SPPerformancePointServiceApplication noun. The syntax would look like this:
New-SPPerformancePointServiceApplication -Name "MyFirstApplication" –AppPool "PPS
App Pool" New-SPIisWebServiceApplicationPool
Cmdlets Available Out of the Box
This section summarizes the cmdlets that are available out of the box. These tables describe the parameters for each cmdlet.
The cmdlet in Table 1 creates a new PPS Service application with the specified parameters.
Table 1. New-SPPerformancePointServiceApplication
Property Name | Type | Description |
---|
Name | String | The name of the service application. |
| | This is a required parameter. |
Administrators | String[] | The group of users who have permission to administer the service application. |
| | The default value is the SharePoint Farm Administrators group. |
ServiceAccount | PSCredentials | The credentials of the Unattended Service Account. |
| | This is a required parameter. |
ApplicationPool | String | The
name of the application pool to use for this shared service. The
application pool must be created prior to running this cmdlet. |
| | The New-SPIisWebServiceApplicationPool creates an application pool for you and can be used in conjunction with this cmdlet. |
Tip
The Administrators property is a multivalue string property. To set multiple administrators for this service application, use this syntax:
-Administrators {"domain\admin1","domain\admin2"}
The cmdlet in Table 2 retrieves an existing PPS service application with the specified parameters.
Table 2. Get-SPPerformancePointServiceApplication
Property Name | Type | Description |
---|
Identity | String or GUID | The name or GUID of the service application to retrieve. |
| | If this parameter is not specified, a list of all service applications will be returned. |
Tip
This cmdlet is most useful
when querying for all service applications in a farm. It is also
frequently used as an input to other cmdlets.
This cmdlet in Table 3 changes the settings of an existing PPS service application.
Table 3. Set-SPPerformancePointServiceApplication
Property Name | Type | Description |
---|
Identity | String | The name or GUID of the service application to set the properties of. |
| | This is a required parameter. |
ServiceAccount | PSCredentials | The credentials of the Unattended Service Account. |
| | This is a required parameter. |
ApplicationPool | String | The name of the application pool to use for this Shared Service. If the application pool does not exist, one will be created. |
| | The default value is the name of the service application. |
There are a number of values that are applicable to most of the New, Get, and Set SPPerformancePointServiceApplication
cmdlets. These shared values can be used by all the cmdlets discussed
earlier. The shared values control various settings, most of which are
available to set in the Shared Service Administrative user interface.
For example, if you want to
pass a parameter to disable all comments on scorecards when creating a
new PPS shared service application, all you need is this cmdlet with the
CommentsDisabled shared value:
New-SPPerformancePointServiceApplication -name "MyFirstServiceApplication"
-CommentsDisabled true
This same syntax also works with the Set-SPPerformancePointServiceApplication cmdlet:
Set-SPPerformancePointServiceApplication -name "MyFirstServiceApplication"
-CommentsDisabled true
For retrieving the current value of this setting with the Get-SPPerformancePointServiceApplication cmdlet, you need to use this syntax:
(Get-SPPerformancePointServiceApplication –identity
"MyFirstServiceApplication").CommentsDisabled
Table 4 describes the shared values you can use with cmdlets.
Table 4. Shared Values for the SPPerformancePointServiceApplication Family of
Property Name | Type | Description |
---|
CommentsDisabled | Boolean | Allows users to add comments to scorecard cells. |
CommentsScorecardMax | Integer | Maximum number of comments per scorecard. |
IndicatorImageCacheSeconds | Integer | Seconds to cache KPI icons. |
DataSourceQueryTimeoutSeconds | Integer | Seconds to time out for a data source query. |
DecompositionTreeMaximum | Integer | Maximum number of items shown in a decomposition tree. |
FilterRememberUserSelectionsDays | Integer | Days to remember user filter selections. |
FilterTreeMembersMax | Integer | Maximum number of records to show in filter tree view control. |
SelectMeasureMaximum | Integer | Maximum number of measures to show in a dashboard. Select measure control. |
ShowDetailsInitialRows | Integer | Initial number of rows to retrieve for show details. |
ShowDetailsMaxRowsDisabled | Boolean | Disable ShowDetailsInitialRows setting. If set to True, Analysis Services will control limit. |
ShowDetailsMaxRows | Integer | Maximum number of rows to retrieve for show details. |
MSMQEnabled | Boolean | Send notifications to Microsoft Message Queuing (MSMQ) on content change. |
MSMQName | String | Queue name of the Microsoft Messaging Queue. |
SessionHistoryHours | Integer | Hours to keep user navigation history. |
AnalyticQueryLoggingEnabled | Boolean | Verbose logging of query events. |
AnalyticQueryCellMax | Integer | The maximum number of values to return in an Analytic Chart or Grid. |
| | The
default value is 100,000. If a user attempts to create an analytic grid
that has 100 columns and 1001 rows, PPS will show an error rather than
rendering such a large report. |
TrustedContentLocationsRestricted | Boolean | When switched on, only trust specified locations. Default is to trust all content locations. |
TrustedDataSourceLocationsRestricted | Boolean | When switched on, only trust specified locations. Default is to trust all data source locations. |
DataSourceUnattendedServiceAccountUsername | String | The user name of the Unattended Service Account. |
SettingsDatabase | String | The location of the database. |
Tip
There are a few other
properties available that are not listed in this table, such as some
caching settings. They exist mainly for debugging caching scenarios
during the development of the product and should remain untouched in all
deployments.
Whenever you create a
service application, best practice is to create a service application
proxy to go with it. These go together like peanut butter and jelly;
both are needed for each to work.
Table 5 describes a cmdlet that creates a new proxy for an existing service application.
Table 5. New-SPPerformancePointServiceApplicationProxy
Property Name | Type | Description |
---|
Name | String | The name of the service application proxy.
This is a required parameter. |
ServiceApplication | String or GUID | The
name or GUID of the service identity with which to associate this
proxy. The GUID is a system assigned identifier that can be queried.
This is a required parameter. |
Administrators | String[] | The group of users who have permission to administer the service application proxy.
The default value is the SharePoint Farm Administrators group. |
The cmdlet in Table 6
is used to remove service application proxies when they are no longer
needed. Just like with creation, best practice is to delete the proxy at
the same time you delete the service application.
Table 6. Remove-SPPerformancePointServiceApplicationProxy
Property Name | Type | Description |
---|
Identity | SPCmdletObjectId | The name of the service application proxy to delete.
This is a required parameter. |
The cmdlet in Table 7 adds a new entry to the trusted data source or trusted content locations.
Table 7. New-SPPerformancePointServiceApplicationTrustedLocation
Property Name | Type | Description |
---|
URL | String | The URL for the trusted location to add.
The type of content at the URL specified in the URL parameter. Valid values are as follows: |
Type | Enumeration | SiteCollection Site DocumentLibrary
|
ServiceApplication | GUID or String | Service application associated with this location.
The type of content to trust in the specified location. Valid values are as follows: |
TrustedLocationType | Enumeration | DataSource Content
|
Note
Use this cmdlet with the TrustedDataSourceLocationsRestricted or TrustedContentLocationsRestricted
settings on the service application. By default, everything is trusted,
which means that adding new locations to trust will not have any effect
unless the service application has been set to trust nothing.
The cmdlet in Table 8 retrieves all trusted locations set for a specific service application.
Table 8. Get-SPPerformancePointServiceApplicationTrustedLocation
Property Name | Type | Description |
---|
ServiceApplication | GUID or String | Service application associated with this location |
The cmdlet in Table 9 removes a single entry as a trusted location.
Table 9. Remove-SPPerformancePointServiceApplicationTrustedLocation
Property Name | Type | Description |
---|
Identity | String | ID property (GUID) of the trusted location to remove |
Clear-SPPerformancePointServiceApplicationTrustedLocation
The cmdlet in Table 10
removes all trusted locations, including data source and content that
have been set previously for a specific service application.
Table 10. Clear-SPPerformancePointServiceApplicationTrustedLocation
Property Name | Type | Description |
---|
ServiceApplication | GUID or String | Service application associated with this location |
The cmdlet in Table 11 retrieves the status of the secure store target application and the name of the unattended service account.
Table 11. Get-SPPerformancePointSecureDataValues
Property Name | Type | Description |
---|
ServiceApplication | GUID or String | Service application associated with this location |
The cmdlet in Table 12 sets the Unattended Service Account credentials.
Table 12. Set-SPPerformancePointSecureDataValues
Property Name | Type | Description |
---|
ServiceApplication | GUID or String | Service application associated with this location |
DataSourceUnattendedServiceAccount | PSCredential | The identity to which to set the unattended service account |