Upgrading to 2010: Feature and WebPart Inventory Reports

I'm back with another post about Upgrading to SharePoint 2010.

The stsadm -o preupgradecheck provides a wealth of information of a SharePoint deployment however this isn't always enough information. The preupgrade report includes the number of references to features and webparts but key information is missing.... where exactly are those features and webparts being used?

Features and webparts are core functionality to SharePoint but finding what
sites are using them and where is often a tedious and time consuming process.

Knowing this level of details allows for:

  • Understanding the usage pattern of deployed webparts and features. Maybe some features are widely used while others are not used at all. It can be helpful for determining which items should be updated for 2010 and which can be considered for decommissioning.
  • Troubleshooting. Without knowing where and how these items are being used you cannot understand the potential implications of a broken feature / webpart.

I have created the following scripts which can be used to inventory locations and use of custom built, third party and out of box features and webparts. This information has proven very useful in upgrading our hosted Office 365 customers. The next sections will detail the scripts and how to run them and use the results, find the scripts attached to this post.

Get-FeatureWebPartInventory.ps1

Run this script on a SharePoint 2007 or 2010 WFE to generate two reports
containing:

  1. All environment features (Farm, Web Application, Site and Web scoped
    features) as well as the locations they are activated at.
  2. All webparts being used in site collections and webs.

Requirements

  • SharePoint 2007 October 2009 CU or SharePoint 2010
  • PowerShell V2

Usage

Copy the script it a web front end and run it.
Depending on the size of the farm it can take hours to run. Under the covers it is utilizing the stsadm -o enumallwebs -includefeatures -includewebparts along with some additional logic to get all scoped features. When finished the
generated CSV report locations (one for webparts and one for features) will be
shown and you will be given the option to open them.

Analyzing Report Results

The two reports are in a CSV format and I recommend using Excel 2010 x64 to do some
analysis, as these files can be quite large. Here is a sample features report:

Create a pivot table for each data set in Excel and use that to do
some analysis. The below window shows an example of referenced but missing
webparts AND the site URLs that are affected. Only the GUIDs are provided
in this case because SharePoint does not know what they are named.

By creating a pivot table you can see which Features are Installed or
Missing, sort by the number of installs and view the actual URLs where these
components are being used. The preupgradecheck report only shows the count of
installs where as with these data sets you can see the affected URLs.

 

This information helps answer the commonly asked questions:

  • What sites are using what features and webparts?
  • How wide spread is the use of a given feature or webpart? Very useful for
    determining customization decommission plans.
  • Are there any missing features / webparts? If so what site URLs?

Webparts are different from features in that they live on specific pages.
You may have the site URL that is using a webpart, but how do you find the exact
pages the webpart is installed on? Check out the Find-WebPartPages.ps1 script below.

Find-WebPartPages.ps1

Run this script on a SharePoint 2007 WFE to locate the actual page URLs
where a webpart is installed. It also creates a CSV output report of the
locations.

Please Note: This script directly queries the SharePoint content DBs which technically isn't supported however this is a read only query and it employs non-blocking techniques. It is recommended to copy your content to a staging location, test first and use at your own risk.

Requirements

  • SharePoint 2007

Usage

  • Copy the script to a 2007 WFE
  • When prompted enter the Config db name, SQL server name and webpart GUID to
    locate

This is an example of the report that is generated.

 

You can use this information to navigate to the exact pages where a webpart
is installed to verify if it is missing, broken or whatever your needs
are.

I hope you find these scripts helpful!

-Sean

 

Disclaimer

The sample script and data file described in this guide are not supported
under any Microsoft standard support program or service. The sample script and
data file are provided AS IS without warranty of any kind. Microsoft further
disclaims all implied warranties including, without limitation, any implied
warranties of merchantability or of fitness for a particular purpose. The entire
risk arising out of the use or performance of the sample scripts and
documentation remains with you. In no event shall Microsoft, its authors, or
anyone else involved in the creation, production, or delivery of the scripts be
liable for any damages whatsoever (including, without limitation, damages for
loss of business profits, business interruption, loss of business information,
or other pecuniary loss) arising out of the use of or inability to use the
sample scripts or documentation, even if Microsoft has been advised of the
possibility of such damages.

 

Feature_Webpart_Inventory_Finder_Scripts.zip

Comments

  • Anonymous
    January 09, 2012
    Hi, I'm sorry but your second script to find Web Part executes find but I never get any results for any Web Part ID I enter.