SharePoint Use Cases

04 Aug, 2010

Add all site collections as PerformancePoint trusted locations via PowerShell

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

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

1 | Twitted by csharpzealot

August 4th, 2010 at 4:42 pm

Avatar

[...] This post was Twitted by csharpzealot [...]

2 | Tweets that mention Add all site collections as PerformancePoint trusted locations via PowerShell | SharePoint Use Cases -- Topsy.com

August 4th, 2010 at 5:04 pm

Avatar

[...] This post was mentioned on Twitter by Planet SharePoint, Brian H. Madsen, Toni Frankola, Jim Poshible, SharePoint River and others. SharePoint River said: #SharePoint #SP2010 Add all site collections as PerformancePoint trusted locations via PowerShell http://ow.ly/18qWjX [...]

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.

Page optimized by WP Minify WordPress Plugin