I ran the following powershell however, it only list 20 items and in reality I have about 50 items for the site I am running for. I am the farm and site admin. I see 50 files when I go to the library setting manage checked out files http://inside.nv.ed/teams/mkt/_layouts/ManageCheckedOutFiles.aspx?List=%7BBF36234B%2D0303%2D470D%2D887C%2D3A4724FFCB58%7D. Any idea why there is a discrepancy?
Add-PSSnapin Microsoft.SharePoint.PowerShell
$spWeb = Get-SPWeb "http://inside.nv.ed/teams/mkt"
foreach ($list in ($spWeb.Lists | ? {$_ -is [Microsoft.SharePoint.SPDocumentLibrary]})) {
#Write-Host "Scanning List: $($list.RootFolder.ServerRelativeUrl)"
$CAML = "<Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/><Value Type='int'>0</Value></Geq></Where>"
#$CAML = "<where><isnull><fieldref lookupid='TRUE' name='CheckoutUser'></fieldref></isnull></where>"
$query = new-object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'"
$query.Query = $CAML
$listitems = $list.GetItems($query)
#write-host $listitems.Count
foreach ($item in $listitems)
{
#write-host $item.url
$fullURL=$spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)")
write-host $fullURL
}
}
if !$item.Url.EndsWith(".aspx")) { continue }
Could it be that you are only looking for specific files?