Sometimes for maintenance we need to enumerate all web parts in Sharepoint web application. The following script can be used for that:
It enumerates all site collections in web application (line 41), then all sub sites in each site collection (line 31), all pages in each sub site (line 25) and finally all web parts on each page (lines 10-16). This script can be used e.g. if you need to find web part of particular type or title on all sub sites in your web application and make changes in them. Hope that this script will be useful in your work.