Hi @Shri-6058 ,
You could try the below script to get the report on all list/library items for web application:
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$webapplication=get-spwebapplication http://sp16
$sites=$webapplication.sites
$collection=@()
foreach($site in $sites){
foreach($web in $site.allwebs){
$lists=$web.lists | where Hidden -eq $False
foreach($list in $lists){
$list.items | foreach {
$ExportItem = New-Object PSObject
$ExportItem | Add-Member -MemberType NoteProperty -name "Site" -value $site.url
$ExportItem | Add-Member -MemberType NoteProperty -name "Web" -value $web.url
$ExportItem | Add-Member -MemberType NoteProperty -name "List" -value $list.Title
$ExportItem | Add-Member -MemberType NoteProperty -name "Id" -value $_.id
$ExportItem | Add-Member -MemberType NoteProperty -name "Title" -value $_["Title"]
$ExportItem | Add-Member -MemberType NoteProperty -name "FileRef" -value $_["FileRef"]
$collection += $ExportItem
}
}
}
}
$collection | Export-CSV "c:\Report.csv" -NoTypeInformation
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.