$site=get-spsite http://sp/sites/Echo // the specific site URL $ct = @() foreach($Web in $site.AllWebs) { foreach($list in $Web.Lists) { if($list.BaseTemplate -eq "DocumentLibrary" -and $list.AllowContentTypes -eq $true) // All Document Libraries { foreach ($listItem in $list.Items) { $filetype=$listItem["Type"] if($filetype -eq "xlsx") { $ctObject = New-Object -TypeName PSObject // list files properties $ctObject | Add-Member -Name 'WebUrl' -MemberType Noteproperty -Value $web.URL $ctObject | Add-Member -Name 'ListTitle' -MemberType Noteproperty -Value $list.Title $ctObject | Add-Member -Name 'FileUrl' -MemberType Noteproperty -Value $listItem.URL $ctObject | Add-Member -Name 'FileName' -MemberType Noteproperty -Value $listItem.name $ctObject | Add-Member -Name 'CreatedTime' -MemberType Noteproperty -Value $listItem["Created"] $ct += $ctObject } } } } } $ct | export-csv "C:\report1.csv" // the Report location