Skip to content

Instantly share code, notes, and snippets.

@xoner
Last active August 29, 2015 14:13
Recursively looks for files owned by a specified user in a folder and exports them to a csv (excel) spreadsheet.
Get-ChildItem -Force -Recurse -File |
Select *,@{n='Owner';e={(Get-Acl -LiteralPath $_.FullName).Owner}} |
Where {$_.Owner -eq 'DOMAINNAME\username'} | Select FullName, Owner, Length |
Export-Csv Files-User.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment