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

As a site administrator tool I have to list all checked out files in the site collection. Looking at the DB is looks like the tp_CheckoutUserId field in AllUserData might be a key to this query.

Is it possible to get this information through the web services or will I have to use the object model?

Update: It seems like the customer would like to be able to list just those files that have been checked out (not necessary modified) by a specific user. Onless the query takes several minutes it should be a realtime query, but the site collection consist of +10 000 web with 3 document libraries on each web so performance might be an issue.

share|improve this question
add comment

3 Answers 3

up vote 6 down vote accepted

Depending on what you are trying to do there are a few approaches to this:

-- Use the Manage Content and Structure Reports as per http://blogs.syrinx.com/blogs/sharepoint/archive/2008/04/14/content-and-structure-reports-just-a-caml-ride-away.aspx but this is fairly limited as it doesn't let you specify who checked out the document and on which site.

-- Use the object model - this gives you more flexibility but requires the code to be running on the SharePoint server. To do this you could use a query such as the following:

using (SPWeb web = new SPSite("http://intranet/").OpenWeb())
{
    SPSiteDataQuery q = new SPSiteDataQuery();
    q.Lists = "<Lists BaseType='1'/>";
    q.Query = "<Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/><Value Type='int'>0</Value></Geq></Where>";
    q.Webs = "<Webs Scope='SiteCollection' />";
    q.ViewFields = "<FieldRef Name='Title' /><FieldRef Name='ID' />";
    q.RowLimit = 10;
}

-- Use the web services to allow you to run the code remotely. This would likely require more effort but should be achievable using the Query web service as long as you expose the CheckoutUser field as a managed property in the search settings for the SSP.

share|improve this answer
    
Hi, I was wondering if this could be modified to run on the client side? We don't have access to the server so my options are quite limited. Is it possible? –  Batman Sep 6 '13 at 13:23
add comment

One way you could do, but I'm not sure how well recommended it would be, is to use the object model to recursively iterate over your site collection and document libraries to collect a list of all documents that are checked out.

The reason for my unsure of how well recommended this approach would be is that it would be very inefficient and slow I think, depending on your code practice. For a one-off tool to run every now and again it could work ok though.

share|improve this answer
add comment

Have you checked out Manage Content and Structure Reports?

http://office.microsoft.com/en-us/sharepointserver/HA101317231033.aspx#8

Theres shortcuts to the OOTB reports from Site Actions, and you can also "roll your own".

share|improve this answer
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.