OK, so from the GUI you can see this info like: http://intranet.pbnet.pbnet.local/_layouts/ManageCheckedOutFiles.aspx?List=<LIST GUID>.
This script will cycle through all the libraries in the web and give you a nice overview on checked-out files and details like: Author of the file, E-mail, Checked-Out By, Checked-Out Since, URL of the file and file size.
So here is the script:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
#Determine if SPS-PS is loaded, if not, load it If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell } # enter your site URL $spWeb = Get-SPWeb "http://intranet.pbnet.pbnet.local" #gather checked-out items function GetCheckedItems($spWeb) { Write-Host "Scanning Site: $($spWeb.Url)" foreach ($list in ($spWeb.Lists | ? {$_ -is [Microsoft.SharePoint.SPDocumentLibrary]})) { Write-Host "Scanning List: $($list.RootFolder.ServerRelativeUrl)" foreach ($item in $list.CheckedOutFiles) { if (!$item.Url.EndsWith(".aspx")) { continue } $writeTable = @{ "URL"=$spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)"); "Checked Out By"=$item.CheckedOutBy; "Author"=$item.File.CheckedOutByUser.Name; "Checked Out Since"=$item.CheckedOutDate.ToString(); "File Size (KB)"=$item.File.Length/1000; "Email"=$item.File.CheckedOutByUser.Email; } New-Object PSObject -Property $writeTable } foreach ($item in $list.Items) { if ($item.File.CheckOutStatus -ne "None") { if (($list.CheckedOutFiles | where {$_.ListItemId -eq $item.ID}) -ne $null) { continue } $writeTable = @{ "URL"=$spWeb.Site.MakeFullUrl("$($spWeb.ServerRelativeUrl.TrimEnd('/'))/$($item.Url)"); "Checked Out By"=$item.File.CheckedOutByUser.LoginName; "Author"=$item.File.CheckedOutByUser.Name; "Checked Out Since"=$item.File.CheckedOutDate.ToString(); "File Size (KB)"=$item.File.Length/1000; "Email"=$item.File.CheckedOutByUser.Email; } New-Object PSObject -Property $writeTable } } } foreach($subWeb in $spWeb.Webs) { GetCheckedItems($subWeb) } $spWeb.Dispose() } #Get results on screen as a Grid GetCheckedItems($spWeb) | Out-GridView # alternative output file text file #GetCheckedItems($spWeb) | Out-File c:\CheckedOutItems.txt -width 300 #Export results to CSV #GetCheckedItems($spWeb) | Export-Csv c:\CheckedOutItems.csv |
