I'm using this script to 'inventory' users' files into an output file. However I also need to figure out a way to inventory the size of total files owned by a user on the file share server. I'd really appreciate a point in the right direction.
[String]$username = "[username]"
[String]$outfile = "[output_file_path]"
$path = Get-ChildItem "." -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
)
}
}