Exchange Powershell 2007

Associate
Joined
1 Mar 2011
Posts
120
Hello once again,

Hopefully I have come to the right place as you guys have helped me out in the past, so calling on the Powershell guru's today! Still fairly new to Powershell so I will do my best. I am trying to set Editor permissions on all sub folders within a public folder on Exchange 2007, the root structure goes as follows:

AllPublicFolders\Process Cooling\PC Projects\*sub folders*

I want to set a user permissions on all the sub folders under PC Projects, I know how to set permissions on PC Projects but as is the way with Exchange all existing sub folders do not inherit these permissions automatically, so they must be set manually, which unfortunately for me there is roughly around 100 of them and I do not have the time of day to do this.

The first command in powershell goes as follows:

Add-PublicFolderClientPermission -Identity "\Process Cooling\PC Projects" -AccessRights Owner -User joe.bloggs

This works fine, I get the text to say this has been set correctly. The next step is to then set all permissions to sub folders within this folder, as follows:

AddUsersToPFRecursive.ps1 -TopPublicFolder "\Process Cooling\PC Projects" -User "joe.bloggs" -Permission Editor

When I enter this in I get the following code back:

Get-PublicFolder : A parameter cannot be found that matches parameter name 'Cooling\PC'.

Can anyone spot where I am going wrong? I have tried all sorts of combinations but I get the same thing where it is unable to find the folder I have listed? Even Powershell help states that there should be a folder name in this parameter. Is there is a different command entirely which would smooth this over?

Thanks in advance :)

SolarP
 
My apologies, would a moderator be able to move this over to the "Servers and Enterprise" forum? Unless anyone here can help of course :)
 
seems as thought the space causes it to see whatever is after it as a command rather than a folder.

Im not sure how you specify it as a space but if you were to rename the folder with an underscore im sure it would go through ok.

as in rename both process cooling and pc projects to:

AddUsersToPFRecursive.ps1 -TopPublicFolder "\Process_Cooling\PC_Projects" -User "joe.bloggs" -Permission Editor

Looks like the space is causing it to see cooling/pc as the next command which it isn't a fan of.
 
Indeed I thought it might be a spacing problem, as with Powershell it is very specific how you word the command. I will definitely try this on Monday (5pm home time!) or maybe on a folder with no spacing and report back.

Many thanks for the suggestion HecFam :)

Keep 'em coming if anyone can think of something else! :p

SolarP
 
Renaming the folders worked. Annoying that on this command alone it wont allow spacing, but it works for all others.

Thanks :)
 
Im sure there is a certain character combo to say a space in powershell, not sure what it is though. Here is something i found about the spaces. SuperUser

The first suggestion about pressing tab may work, I assume it will understand it since it auto completes itself.
 
Try "'\Process Cooling\PC Projects'"


That's the ticket! Funny enough I just spoke with a contact who is a bit of a wiz with Exchange and she suggested using the single quotation marks inside the quotes for folders with spaces. Worked as intended.

Much appreciated all, thank you for the help.

Solarp
 
Back
Top Bottom