[
void
][System.Reflection.Assembly]::LoadWithPartialName(
"Microsoft.SharePoint"
)
function CheckedOutItems() {
write-host
"Please enter the site url"
$url = read-host
write (
"SiteURL`t"
+
"FileName`t"
"CheckedOutTo`t"
"ModifiedDate`t"
"Version"
$site = New-Object Microsoft.SharePoint.SPSite($url)
$webs = $site.AllWebs
foreach
($web
in
$webs)
{
$listCollections = $web.Lists
($list
$listCollections)
if
($list.BaseType.ToString() -eq
"DocumentLibrary"
$dList = [Microsoft.Sharepoint.SPDocumentLibrary]$list
$items = $dList.Items
$files = $dList.CheckedOutFiles
($file
$files)
$wuse = $file.DirName.Substring($web.ServerRelativeUrl.Length)
Write ($web.Url+
"`t"
+ $wuse+
"`/"
+ $file.LeafName +
+ $file.CheckedOutBy.Name +
+ $file.TimeLastModified.ToString()+
"No Checked In Version"
}
($item
$items)
($item[
"Checked Out To"
] -ne $
null
$splitStrings = $item[
].ToString().Split(
'#'
+ $item.Url +
+ $splitStrings[1].ToString() +
+ $item[
"Modified"
].ToString() +
].ToString())
$web.Dispose()
$site.Dispose()
CheckedOutItems
This article is also available in the following languages: French (fr-FR) :
Benoit Jester edited Revision 5. Comment: Add french link
Richard Mueller edited Revision 3. Comment: Modified title casing, Removed tag "SPS2010"
Richard Mueller edited Revision 1. Comment: Modified title casing, minor edits, added tag
Hi Rashul
Thanks for the script, its excellent! im new to Powershell so sorry if its an easy question..
If you wanted to include the email address of the user who has the item checked out, how would you adding this to the script?
Thanks
James
Hi JamesVose,
You just need to modify this line Write ($web.Url+ "`t" + $wuse+"`/" + $file.LeafName + "`t" + $file.CheckedOutBy.Name + "`t" + $file.TimeLastModified.ToString()+"`t" + "No Checked In Version" ).
Here you need to add the EMail property pf SPUser class as $file.CheckedOutBy.Email.
I hope this will help you out.
Thanks,
Rahul Rashu
Benoit Jester edited Revision 4. Comment: Add french link