Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I´m searching for an good way to find the ContentQuery WebPart in my WebApplication. My plan is to write a PowerShell script and create a url list.

I found the following possible ways:

  • SharePoint Object model, I think to slow because I must check every page
  • SQL query, fast but not possible in my environment.

Are there also other ways? Is it possible to use CAML?

share|improve this question
1  
Using the object model, coupled with the SPLimitedWebPartManager, is faster than you think. –  James Love Oct 31 '11 at 13:11
    
Also, see this StackOverflow question (for MOSS 2007) : stackoverflow.com/questions/1498409/… –  SHug Oct 31 '11 at 16:14
add comment

2 Answers 2

up vote 1 down vote accepted

If you're looking for a PowerShell script then I've written one before to do this kind of thing. I've done this several times to find custom web parts that have been in our solution and needed updating following a new release.

My script lists all web parts but it is easily modified to filter out based on the type value of the web part (modify the $wps variable).

share|improve this answer
add comment

The SharePoint Object Model is the (only supported) way to do it.

share|improve this answer
    
You are not allowed to access the Content Databases with SQL as far as i know. –  Stefan Bauer Oct 31 '11 at 20:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.