Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Is there a way to inventory users' files and see total size of all files?

$
0
0

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

                   )
              }

       }


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>