(With my thanks to Fernando Delgado, our excellent setup dev for working up this solution)
After uninstalling PowerPivot for SharePoint, Excel Services and other features in the PremiumSite feature will be disabled. At a certain level for “new server”, this makes sense since turning on and configuring of Excel Services et. al. was part of the “new server” installation. But for “existing farm”, this is a huge NO-NO and will cause considerable aggregation. Fortunately it is easy to fix. In order to re-enable the feature in all the sites in the Farm where it was previously enabled you just need to follow a simple set of steps. If there is a small number of sites, just re-enable them manually with the regular UI. If you would like an automated way, then the following step will scan through the SQL Server log file, pull out those sites that were disable and re-enable them (this is great if you have a large number of sites or if you don’t know which sites to enable manually).
Note: All these steps must be run as administrator
- Go to %ProgramFiles%\Microsoft Sql Server\100\Setup Bootstrap\Log\
- Look for the directory with the modified date corresponding to your uninstall procedure. If no other SQL component else has been installed or you have not run repair, then this should be the directory with the latest date.
- The directory names will be something like YearMonthDay_HourMinutesSeconds choose the newer one and navigate to that directory.
- Copy Detail.txt to a known location like C:\LogFiles
- Copy the file Post–KJUninstall.ps1 (see below) to the same location as the Detail.txt file
- Start the SharePoint 2010 Management Shell as the Farm Administrator account.
- From the shell run the following command (assuming both files are in C:\LogFiles): (as an administrator)
PS C:\LogFiles> C:\LogFiles\Post-KJUninstall.ps1 –UninstallLogFilePath C:\LogFiles\Detail.txt
That should reactivate the PremiumSite feature for all the sites where it was previously enabled.
File: Post-KJUninstall.ps1 :
Param($UninstallLogFilePath)
$file = $UninstallLogFilePathAdd-PSSnapin Microsoft.SharePoint.PowerShell
$powerPivotFeatures = @("1a33a234-b4a4-4fc6-96c2-8bdb56388bd5", "e9c4784b-d453-46f5-8559-3c891d7159dd", "f8c51e81-0b46-4535-a3d5-244f63e1cab9")
$premiumSiteId = "8581a8a7-cf16-4770-ac54-260265ddb0b2"#Remove PowerPivot features
foreach($featureId in $powerPivotFeatures)
{
if(Get-SPFeature | where {$_.Id -eq $featureId})
{
Write-Host "Found feature $featureId"
Uninstall-SPFeature -Id $featureId -force
}
}# Verify if the premium site feature was indeed removed
$premiumSiteFeature = Get-SPFeature | where {$_.Id -eq $premiumSiteId}
if($premiumSiteFeature -eq $null)
{
# Re-install the feature
Install-SPFeature -path PremiumSite
}switch -regex -file $file
{
"de-activating feature" {
# This will return every entry in the file for feature deactivation
$Url = $_.Split() | ?{$_ -match "http://([a-zA-Z0-9_\-]+)([\.][[a-zA-Z0-9_\-]+)*(\:[0-9]+)*(/\S*)?"}
#Remove the period at the end
$Url = $Url.Substring(0, $Url.Length – 1)
# Match the Guid for the feature
$Id = $_.Split() | ?{$_ -match "([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}"}
if(!($powerPivotFeatures -contains $Id))
{
Write-Host "Re-activating feature $Id on site $Url"
Enable-SPFeature -Id $Id -Url $Url
trap
{
Write-Host "Could not Re-activate feature $Id on site $Url"
Write-Host $("Exception: "+ $_.Exception.Message);
continue
}
}continue
}
}


Thanks for that, although I got the underneath massage. May be MS resolved this already. Will install PowerPivot Server again. Hope now it works.
Cheers, Frits
PS C:\logfiles> C:\LogFiles\Post-KJUninstall.ps1 -UninstallLogFilePath C:\LogFil
es\Detail.txt
Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.SharePoint.Power
Shell because it is already added. Verify the name of the snap-in and try again
.
At C:\LogFiles\Post-KJUninstall.ps1:4 char:17
+ Add-PSSnapin <<<
I’m not sure if I use premiumsite features but I tried this anyway after an uninstall of powerpivot. I get the following error. Should it matter? I did undeploy one of the powerpivot solutions from central admin before the uninstall.
Found feature 1a33a234-b4a4-4fc6-96c2-8bdb56388bd5
Uninstall-SPFeature : Cannot find a Feature object with Path or Id: 1a33a234-b4
a4-4fc6-96c2-8bdb56388bd5 in scope Local farm.
At C:\LogFiles\Post-KJUninstall.ps1:15 char:32
+ Uninstall-SPFeature <<<< -Id $featureId -force
+ CategoryInfo : InvalidData: (Microsoft.Share…ninstallFeature:
SPCmdletUninstallFeature) [Uninstall-SPFeature], SPCmdletPipeBindException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletUninstal
lFeature
[...] Uninstalling PowerPivot does what ?? Arg!!@@!!! Changing service accounts and handling password resets [...]
[...] Run scripts to re-enable PremiumSite feature. See http://powerpivotgeek.com/2010/06/14/uninstalling-powerpivot-does-what-arg/ [...]
[...] Run scripts to re-enable PremiumSite feature. See http://powerpivotgeek.com/2010/06/14/uninstalling-powerpivot-does-what-arg/ [...]
[...] 2. http://powerpivotgeek.com/2010/06/14/uninstalling-powerpivot-does-what-arg/ [...]