In order to effectively make changes to your SharePoint solution, it is beneficial to maintain a complete list of custom artifacts deployed to your environment.
SharePoint 2010 offers a few options for listing any artifact or customization that’s been installed and used in your SharePoint solution.
Fortunately, you can test the following options in your CloudShare test environment:
SharePoint STSADM classic command line tool
STSADM (located at the 14 hive in your SharePoint 2010 installation) allows you to enumerate all the WebParts, Event Handlers, or custom lists deployed, by using the “enumallwebs” option. This option includes optional parameters for listing these customizations.
For example, you can type in the command line all the available options for “enumallwebs” and store the information generated in an xml file.
In the xml file generated, you can easily check all customizations deployed in your SharePoint environment, such as installed features. This is really important because these features should be installed in a new environment in order to ensure a successful upgrade or solution movement.
SharePoint 2010 introduced PowerShell as the first class command line option for managing SharePoint environments, as opposed to the classic STSADM tool. PowerShell for SharePoint 2010 includes more than 600 cmdlets, which allow you to manage a SharePoint environment completely.
There are some administrative tasks that can only be done through PowerShell and are not available in the SharePoint 2010 Central Administration or the SharePoint Object Model. PowerShell is much more of a shell script language. It allows you to work with real SharePoint objects and it’s completely extensible since you can also create your own cmdlets. The equivalent cmdlet to the “enumallwebs” STSAM operation is Get-SPWeb, which represents a SPWeb object. If you want to know the information that will display from executing this command, type Get-help Get-SPWeb in the SharePoint 2010 Management Shell:
If you want to know the available features on an existing site, just type the following PowerShell sequence:
As a result, you’ll see a list with information related to all the features available in the site:
SharePoint Server Object Model
Finally, the SharePoint Server Object Model is a powerful choice that I really love to use. SharePoint provides a rich object model that you can work with at any level in the SharePoint hierarchy from the highest (a SharePoint farm) to the lowest (a SharePoint list item).
The following code block allows you to list information about available features in a SharePoint site by using SPSite, SPWeb, and SPFeature objects:
Similarly, you can obtain all the SharePoint solutions deployed to the catalog at the farm level. You can also use this code block to download any .WSP stored in the catalog:
The following screen shot shows you the generated output:
There are third party tools, like WinDiff, that you can use to simplify the process.
That summarizes the options available to identify custom artifacts and customizations done in a SharePoint environment.