none
Public folder in exchange 2010 RRS feed

  • Question

  • 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.
     
    Get-PublicFolderStatistics -ResultSize Unlimited |  where {$_.LastUserAccessTime -lt (get-date).AddDays(-90)}
     
    Get-PublicFolderStatistics -ResultSize Unlimited | Get-PublicFolderClientPermission | Where {($_.AccessRights -eq "Owner"}
     
    Can I merge these two script in single one so I have single excel having public folder lists and their owner?
     

     

    Wednesday, May 27, 2015 3:55 PM

All replies

  • >> 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


    Thursday, May 28, 2015 10:35 AM