Zero Hour Sleep … lost in a 24×7 IT world

18Dec/093

Managing spaces in AddReplicaToPFRecursive.ps1 script

If you are familiar with Microsoft Exchange 2007 you already know about the AddReplicaToPFRecursive.ps1 script that can be found in the "X:\Program Files\Microsoft\Exchange Server\Scripts", however this script has a bug it doesn't look to support public folders which names contains spaces.

It is quite common to enclose parameters that contains spaces with "quotations" but that doesn't work here.

If you simply try to use the following it will fail.

AddReplicatoPFRecursive.ps1 -TopPublicFolder “\PublicFolder with space” -ServerToAdd “servername”

The solution turned out to be to use single quotes inside the double quotes so it should be something like

AddReplicatoPFRecursive.ps1 -TopPublicFolder “'\PublicFolder with space'-ServerToAdd “servername”

That's really weird and not standard but it works !

About Antoine Khater

I have been working in IT consultancy and solution integration since 1998 and I consider myself lucky to be, one in a few, making a living out of my passion. I am also member of the famous Experts Exchange (profile here) online community where I try my best to share what I have learned along the road.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments (3) Trackbacks (0)
  1. That must have been tricky to catch

  2. Thanks for the clue. Very helpful.

  3. How do i recursivly remove a server?


Leave a comment


No trackbacks yet.