Link to home
Start Free TrialLog in
Avatar of bakerm00
bakerm00Flag for United Kingdom of Great Britain and Northern Ireland

asked on

cannot add public folder replica partners via script

we have a wide and varied public folder heirarchy due to operational requirements.
to migrate the public folder data to exchange 2007 - we need to migrate it per site/database
we cannot use the existing exchange scripts that assume we can add replica partners to the folder heirarchy
we need to add a public folder replica partner to every replica on a specific servers database
i have pillaged the microsoft \scripts folder to generate such a script.
Param(
                [string] $Server,
                [string] $ServerToAdd= ""
)
$dbAdd = get-publicfolderdatabase -server $ServerToAdd -erroraction Stop
get-publicfolder \ -Recurse | ?{$_.Replicas -like "*LABSRV02*"} | ForEACH {
                If (!$_.Replicas.Contains($dbadd.identity)) {
                                $_.Replicas += $dbadd.Identity;
                }
                $_ | set-publicfolder -server $_.originatingServer;

}
in the lab (one ex2003 PF DB, One e12 PF DB) we can run the above script and it will add the replica partner of e12 server to each public folder on ex2003 server db.

however in preprod - we have  an expanded lab, which has multiple ex2003 servers with PF dbs and two exchange 2007 servers with a single DB
when running the same script - it will not add any e12 replica partner server pf db to the target 2003 server hosted public folders.  the script runs with out error.
can anyone shed any light?
Param(
                [string] $Server,
                [string] $ServerToAdd= ""
)
$dbAdd = get-publicfolderdatabase -server $ServerToAdd -erroraction Stop
get-publicfolder \ -Recurse | ?{$_.Replicas -like "*LABSRV02*"} | ForEACH {
                If (!$_.Replicas.Contains($dbadd.identity)) {
                                $_.Replicas += $dbadd.Identity;
                }
                $_ | set-publicfolder -server $_.originatingServer;
 
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of bakerm00
bakerm00
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial