SharePoint Use Cases

04 Aug, 2010

Add all site collections as PerformancePoint trusted locations via PowerShell

Posted by: Toni Frankola In: SharePoint|SharePoint 2010

In case you have been playing with SharePoint 2010 IW Demo VM you might bumped into this error:

The query could not complete because the following items are not in a PerformancePoint trusted location…

The solution for this problem is simple, you just need to add all PerformancePoint locations to the trusted list in PerformancePoint service application. I usually use IW Demo machine to do demos and sometimes during presentation a customer might request you to present something (like PerformancePoint) that was not on your demo agenda.

To make sure the errors like the one above do not appear in front of your customer I wrote a simple scripte that will automatically add all existing site collection as trusted PerformancePoint locations. Please note that this is for demo purposes only and you should not execute this in production enviroment before consulting your system adminstrator.

Here is the script:

# check to ensure Microsoft.SharePoint.PowerShell is loaded
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null) {
  Write-Host "Loading SharePoint Powershell Snapin"
  Add-PSSnapin "Microsoft.SharePoint.Powershell"
}

$ppApp = Get-SPPerformancePointServiceApplication

$ppApp | Get-SPPerformancePointServiceApplicationTrustedLocation | Where {$_.RepositoryLocationType -eq "SiteCollection"}| Remove-SPPerformancePointServiceApplicationTrustedLocation

Get-SPSite -Limit All | Where{$_.Url -notlike "*/personal/*" -and $_.Url -notlike "*/my"} | ForEach-Object {
	$ppApp | New-SPPerformancePointServiceApplicationTrustedLocation -Url $_.Url -TrustedLocationType Content -Type SiteCollection
	$ppApp | New-SPPerformancePointServiceApplicationTrustedLocation -Url $_.Url -TrustedLocationType DataSource -Type SiteCollection
}

$ppApp | Get-SPPerformancePointServiceApplicationTrustedLocation

Few notes:

  • This script first deletes all trusted locations of SiteCollection type
  • It adds all site collections in your farm excluding those that have my or personal as part of their URL (MySites)


Documentation Toolkit for SharePoint

Comments

Comment Form

 

About

Real-life use case and opinions about collaboration, CRM and web technologies and stuff by Toni Frankola. More...

Toni Frankola - SharePoint MVP Profile

All postings on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.