≡ Menu

How to verify the public folder replication status in Exchange 2010

Yesterday I got a requirement to verify if a given list of folders are replicated to new installed PF server or not. I added the new sever to replica list of required PF folders and now I need to verfiy if the replication is completed so that I can remove the old PF server from the replica list.

Either Exchange management console or the exfolder util(utility to manage PF replicas and permissions) is not having the option to verify the replication status. Exfolder.exe is helpful to some extent as it is showing the list of items in that PF so that I can compare and confirm that all mails are replicated. I can do this for folders which has less number of items, but if the folder has more number of emails, then it is not a ideal way of doing it.

After researching for time, I found the way that solves my problem. The “Get-PublicfolderStatistics” cmdlet is the right choice here. I used this and generated the email items count in a PF from a particular PF server. After that ran two queries (listed below) and directed the output to a file for comprison. I tried to assign the output of each command to a variable and tried to compare-object cmdlet to compare the contents of both the output variables, but it didn’t work as exepcted for some weird reason. Let me know if it works for you.

Get-PublicFolderStatistics -Server PFServer1            
Get-PublicFolderStatistics -Server PFServer2

Hope this helps…

 

Comments on this entry are closed.

  • Jay March 27, 2012, 8:34 pm

    This will compare the two. Written by me, use as you like:

    write-host “getting first server…”
    $pfs01 = Get-PublicFolderStatistics -ResultSize unlimited -server PFServer1 | sort folderpath
    write-host “getting second server…”
    $pfs02 = Get-PublicFolderStatistics -ResultSize unlimited -server PFServer1 | sort folderpath
    write-host “Doing stuff…”

    $count = 0

    $pfs01 | foreach {
    $items = $_.itemcount
    $pat = $_.folderpath

    $item2 = $pfs02[$count].itemcount
    $pat2 = $pfs02[$count].folderpath
    $mod2 = $pfs02[$count].LastModificationTime

    $dif = $items – $item2

    if ($dif -gt 1) { # adjust this number >=1 to account for changes/replication
    # NOTE: if paths do not match, some folders do not exist on both servers.
    $message = ” `”$items`”, `”$item2`”, `”\$pat`”, `”\$pat2`”, `”$mod2`””
    Write-host “$message” -f green
    out-file -inputobject $message -NoClobber -Append -FilePath .\pflog.log
    $found = “true”
    }
    $count=$count +1
    }

  • MrT July 7, 2012, 1:47 am

    This will come in very handy, appreciate your efforts.
    Thank you

  • Kalen Krueger March 26, 2013, 6:46 am

    Extremely useful… I made a couple of changes so I would actually know that it’s doing something… 🙂

    write-host “getting first server…”
    $pfs01 = Get-PublicFolderStatistics -ResultSize unlimited -server | sort folderpath
    write-host “getting second server…”
    $pfs02 = Get-PublicFolderStatistics -ResultSize unlimited -server | sort folderpath
    write-host “Doing stuff…”

    $count = 0

    $pfs01 | foreach {
    $items = $_.itemcount
    $pat = $_.folderpath

    $item2 = $pfs02[$count].itemcount
    $pat2 = $pfs02[$count].folderpath
    $mod2 = $pfs02[$count].LastModificationTime

    $dif = $items – $item2

    $message = ” `”$items`”, `”$item2`”, `”\$pat`”, `”\$pat2`”, `”$mod2`””
    Write-host “$message” -f green

    if ($dif -gt 1) { # adjust this number >=1 to account for changes/replication
    # NOTE: if paths do not match, some folders do not exist on both servers.
    $message = ” `”$items`”, `”$item2`”, `”\$pat`”, `”\$pat2`”, `”$mod2`””
    Write-host “$message” -f red
    out-file -inputobject $message -NoClobber -Append -FilePath .\pflog.log
    $found = “true”
    }
    $count=$count +1
    }