Microsoft tells you how to do this manually per site: http://msdn.microsoft.com/en-us/library/bb677366.aspx.
I, on the other hand, want to do this via PowerShell as a last step in auto-configuration of Report Server Integration.
First, I have a little utility function for activating features within SharePoint.
# #######################
# ##### Utility Functions #####
# #######################
# A generic function for enabling a SharePoint feature
function ActivateFeature()
{
# Required parameters for enabling a feature
param([string]$Identity = $(throw "-Identity parameter is required"), [string]$Url = $(throw "-Url parameter is required"))
Enable-SPFeature -Identity $Identity -Url $Url
}
# #######################
# #######################
Second, I use that function during the process of looping through site collections on the farm.
# ############################################
# ##### Activate Report Server Integration Feature #####
# ############################################
try
{
# Capture array of Farm SPService objects into a local variable
$webAppSrvs = (Get-SPFarm).Services
{
# Capture array of Farm SPService objects into a local variable
$webAppSrvs = (Get-SPFarm).Services
# Loop through each SPService object
foreach($webService in $webAppSrvs)
{
Write-Log $logFile "Web Service ($($webService.TypeName)) WebApp.Cnt: $($webService.WebApplications.Count)" $lvlInfo
foreach($webService in $webAppSrvs)
{
Write-Log $logFile "Web Service ($($webService.TypeName)) WebApp.Cnt: $($webService.WebApplications.Count)" $lvlInfo
# Loop through each SPWebApplication object that exists under the current SPService object.
foreach($webApp in $webService.WebApplications)
{
Write-Log $logFile "Web App: $($webApp.name); Feat Cnt: $($webApp.Features.Count); Prop Cnt: $($webApp.Properties.Count)" $lvlInfo
foreach($webApp in $webService.WebApplications)
{
Write-Log $logFile "Web App: $($webApp.name); Feat Cnt: $($webApp.Features.Count); Prop Cnt: $($webApp.Properties.Count)" $lvlInfo
# Check for any SPSiteCollection objects under the SPWebApplication object
if ($webApp.Sites.Count -gt 0)
{
# Loop through each SPSiteCollection object
foreach($siteColl in $webApp.Sites)
{
# Capture the current state of access denied exception handling.
$accessDenied = $siteColl.CatchAccessDeniedException
if ($webApp.Sites.Count -gt 0)
{
# Loop through each SPSiteCollection object
foreach($siteColl in $webApp.Sites)
{
# Capture the current state of access denied exception handling.
$accessDenied = $siteColl.CatchAccessDeniedException
# Prevent access denied exceptions from being swallowed.
$siteColl.CatchAccessDeniedException = $false
$siteColl.CatchAccessDeniedException = $false
# Activate features related to Report Server Integration
foreach($feature in $features)
{
try
{
ActivateFeature -Identity $feature.Identity -Url "$($siteColl.Url)"
}
catch
{
Write-Log $logFile $Error[0] $lvlWarn
}
}
foreach($feature in $features)
{
try
{
ActivateFeature -Identity $feature.Identity -Url "$($siteColl.Url)"
}
catch
{
Write-Log $logFile $Error[0] $lvlWarn
}
}
# Return the access deniend exception handling to previous state
$siteColl.CatchAccessDeniedException = $accessDenied
}
}
}
}
$siteColl.CatchAccessDeniedException = $accessDenied
}
}
}
}
Write-Log $logFile "Successfully activated Report Server Integration feature on all existing site collections." $lvlInfo
}
catch
{
Write-Log $logFile $Error[0] $lvlError
}
}
catch
{
Write-Log $logFile $Error[0] $lvlError
}
********************
PowerShell - Report Server Integration - Part 1
PowerShell - Report Server Integration - Part 2
PowerShell - Report Server Integration - Part 3
********************