nav2567
asked on
Public Folder migration statistics - compare get-publicfolderstatistics results.
I am replicating public folders from one mailbox server to another one.
I have found the below script to compare both servers to keep track of progress.
Would someone please modify the script to output the result to a file?
Thanks.
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].LastModific ationTime
$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
}
I have found the below script to compare both servers to keep track of progress.
Would someone please modify the script to output the result to a file?
Thanks.
write-host “getting first server…”
$pfs01 = Get-PublicFolderStatistics
write-host “getting second server…”
$pfs02 = Get-PublicFolderStatistics
write-host “Doing stuff…”
$count = 0
$pfs01 | foreach {
$items = $_.itemcount
$pat = $_.folderpath
$item2 = $pfs02[$count].itemcount
$pat2 = $pfs02[$count].folderpath
$mod2 = $pfs02[$count].LastModific
$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
}
ASKER
Hey Chris,
Is there another compare tool/script I could use to see the same/differences of folders after the migration of the public folder?
I use these commands to replicate the public folders to the new mailbox server. Eventually, the old mailbox server will be shut.
.\AddReplicaToPFRecursive. ps1 -TopPublicFolder “\” -ServerToAdd “mynewmailboxserver”
.\AddReplicaToPFRecursive. ps1 -TopPublicFolder “\NON_IPM_SUBTREE” -ServerToAdd “mynewmailboxserver”
Many thanks.
Is there another compare tool/script I could use to see the same/differences of folders after the migration of the public folder?
I use these commands to replicate the public folders to the new mailbox server. Eventually, the old mailbox server will be shut.
.\AddReplicaToPFRecursive.
.\AddReplicaToPFRecursive.
Many thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works.
Thanks, Dent!!!
Thanks, Dent!!!
ASKER
Thank you!!!
Open in new window
What's would you like to see that isn't already in there?Chris