Basically we have an old Home directory and I would like to dump the entire thing to a CSV file showing the below:
Folder Name | Folder Size | Folder Owner
Folder owner should reflect GUID if we've deleted the user but have not deleted their home directory.
I'd prefer powershell assistance. I think its hopefully as easy as:
$Path = "\\fileserver\homedir"
$Report = "Report.csv"
$Owner = @{
Name = 'Owner'
Expression = { (Get-Acl $_.UserName).Owner }
}
$Fsize = @{
Name = 'Folder Size'
Expression = { (Measure-Object $_.Length).sum }
}
Get-ChildItem -Path $Path | select Name, $Fsize, $Owner | Export-Csv -NoTypeInformation $Report