Hi @sns ,
You could try the below script;
$SiteUrl="http://sp13/sites/michael"
$Report="c:\report.csv"
#Get the site collection
$site=Get-SPSite $SiteUrl
#Write the CSV Header - Tab Separated
"Site Collection Name `t Site Name`t Library `t File Name `t File URL `t Last Modified `t Checked-Out By" | Out-file $Report
#Loop through each site in the site collection
ForEach($Web in $Site.AllWebs){
#Loop through each document library
Foreach ($List in $Web.GetListsOfType([Microsoft.SharePoint.SPBaseType]::DocumentLibrary)){
#Get only Document Libraries
if ($List.Hidden -eq $false){
#Loop through each Item
foreach($ListItem in $List.Items){
If( ($ListItem.File.CheckOutStatus -ne "None") -and ($ListItem.File.CheckedOutByUser -ne $null)){
#Log the data to a CSV file
"$($Site.RootWeb.Title) `t $($Web.Title) `t $($List.Title) `t $($ListItem.Name) `t $($Web.Url)/$($ListItem.Url) `t $($ListItem['Modified'].ToString()) `t $($ListItem.File.CheckedOutByUser)" | Out-File $Report -Append
}
}
}
}
}
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.