Hey guys I have a question and excuse me as I am new to powershell. I have this script here and it basically calculates the total size on a share that a user utilizes. What I would like to do is two things. Place the output in an excel spreadsheet where in one column it displays the users name and the next it displays the value which is the total count. I have tried this with the export csv option but in all attempts have failed to produce this output.
My second question has to deal with the way the output is displayed. If a number falls into a MB then display it in MB and if it is in GB display this in GB.I would appreciate your assistance and the script is below.
$TotalCount = @{}
Get-ChildItem -Recurse \\servername\share | foreach {
$objOwner = (Get-ACL $_.FullName).Owner
$Totalcount[$objOwner] += $_.Length
}
$TotalCount
My second question has to deal with the way the output is displayed. If a number falls into a MB then display it in MB and if it is in GB display this in GB.I would appreciate your assistance and the script is below.
$TotalCount = @{}
Get-ChildItem -Recurse \\servername\share | foreach {
$objOwner = (Get-ACL $_.FullName).Owner
$Totalcount[$objOwner] += $_.Length
}
$TotalCount