I want to look for “Published Documents” library in entire site collection and loop through. I found SPSiteDataQuery looks interesting but it needs serverTemplate id and if I pass 101 it will search all the document libraries but I want to restrict on specific library. How to do that ?
query.Lists = "<Lists ServerTemplate=\"101\" />";
It will only search all the list libraries if you set:
or to get a recursive search:
if you do not set the ‘Webs’ property it will just search the current Web (and list).