>> I have made two script for public folder in exchange 2010.One script give me all the public folder list and other script give me owner list of all public folder.
This Get-PublicFolderStatistics -ResultSize Unlimited | where {$_.LastUserAccessTime -lt (get-date).AddDays(-90)}
give you a filtered list of all the folders that where lasted accessed 90 days okay and
this Get-PublicFolderStatistics -ResultSize Unlimited | Get-PublicFolderClientPermission | Where {($_.AccessRights -eq "Owner"}
Gives you the owner of all the Folders. So something like
$folders = Get-PublicFolderStatistics -ResultSize Unlimited | where {$_.LastUserAccessTime -lt (get-date).AddDays(-90)}
foreach($folder in $folders){
$Owners = ""
$Permissions = Get-PublicFolderClientPermission -Identity $folder.EntryId
foreach($Permission in $Permissions){
if($Permission.AccessRights.Contains("Owner")){
$Owners += $Permission.User.DisplayName + ";"
}
}
Add-Member -InputObject $folder -MemberType NoteProperty -Name Owners -Value $Owners -Force
}
$folders | export-csv -Path c:\temp\folderstats.csv -NoTypeInformation
Cheers
Glen
-
Edited by
Glen ScalesMVP
20 hours 52 minutes ago