PowerPivotGeek?

Who is this mystery man?
Click on the icon to find out. Who is powerpivotgeek?

Uninstalling PowerPivot does what ?? Arg!!@@!!!

(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

  1. Go to %ProgramFiles%\Microsoft Sql Server\100\Setup Bootstrap\Log\
  2. 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.
  3. The directory names will be something like YearMonthDay_HourMinutesSeconds choose the newer one and navigate to that directory.
  4. Copy Detail.txt to a known location like C:\LogFiles
  5. Copy the file Post–KJUninstall.ps1 (see below) to the same location as the Detail.txt file
  6. Start the SharePoint 2010 Management Shell as the Farm Administrator account.
  7. 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 = $UninstallLogFilePath

Add-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
                }
}

  • Share/Bookmark

6 comments to Uninstalling PowerPivot does what ?? Arg!!@@!!!

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>