- Open the PowerShell ISE → Run the following script on the workstation, specifying the network path of a file share or file system, the file owner’s name and the file path for export to csv:
[String]$username = "enterprise\t.simpson"
[String]$username = "enterprise\t.simpson"
[String]$outfile = "C:\scripts\searchowner.csv"
$path = Get-ChildItem "\\pdc\shared\HR" -Recurse
Foreach( $file in $path ) {
$f = Get-Acl $file.FullName
if( $f.Owner -eq $username ) {
Write-Host( "{0}"-f $file.FullName | Out-File `
-Encoding "UTF8" `
-FilePath $outfile -Append)
}
}
- Open the file produced by the script in MS Excel.
Sample report:
- Run Netwrix Auditor → Navigate to "Reports" → Expand the "File Servers" section → Go to "File Servers – State-in-Time" → Select "Files and Folders by Owner" → Click "View".
- Specify the "Object UNC Path" and "Owner" options.
- To export the report to CSV or another format, click the "Export" button → Choose a format from the dropdown menu → Click "Save".
Sample report: