Getting the owners sometimes needs Admin rights but not always. Here are 4 different outputs :
# Compact view for pasting into email Get-ChildItem "D:\SASWork" -File -recurse | select Directory, Name, length, <# path, filename,#> lastwritetime, @{Name="Owner"; Expression={ (Get-ACL $_.Fullname).Owner }} | Sort-Object -Descending length | Out-GridView
# Write to standard output for selecting details Get-ChildItem "D:\SASWork" -File -recurse | select Directory, Name, length, <# path, filename,#> lastwritetime, @{Name="Owner"; Expression={ (Get-ACL $_.Fullname).Owner }} | Sort-Object -Descending length | Format-Table
# Write to csv for DSD parsing with SAS Get-ChildItem "D:\SASWork" -File -recurse | select Directory, Name, length, <# path, filename,#> lastwritetime, @{Name="Owner"; Expression={ (Get-ACL $_.Fullname).Owner }} | Export-CSV -Path D:\sas\Batch\datafiles\D_SASWork_Files_$(get-date -f "yyyyMMdd").csv -NoTypeInformation
# Pre-req : Install-Module ImportExcel -AllowClobber -Force
# Write to xlsx Get-ChildItem "D:\SASWork" -File -recurse | select Directory, Name, length, <# path, filename,#> lastwritetime, @{Name="Owner"; Expression={ (Get-ACL $_.Fullname).Owner }} | Export-Excel -Path D:\SAS_Users\AFarrer\xlsx\D_SASWork_Files_$(get-date -f "yyyyMMdd").xlsx
... View more