Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

cannot add public folder replica partners via script

Posted on 2009-05-19
1
Medium Priority
?
737 Views
Last Modified: 2012-05-07
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

0
Comment
Question by:bakerm00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
bakerm00 earned 0 total points
ID: 24432610
Extra * in ?{$_.Replicas -like ""}
closing.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
This video discusses moving either the default database or any database to a new volume.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question