Question : Powershell Public folder permissions

Experts,

I have an Exchange server which hosts various companies.  I have created a program to add new public folders according to a client's unique identifier using the 'New-PublicFolder -Identity' Powershell command.  This works fine, however I have noticed that these folders are accessible to all existing users.  This obviously is not what I want.  Using the Powershell command, 'Add-PublicFolderClientPermissions' works for a particular user, but I need a method to automatically block (Set permissions to None) for all users.

Is this possible?

Answer : Powershell Public folder permissions


$_.Name will reference the public folder name. If you need the mailbox name...


Get-Mailbox | ForEach-Object {
    $Mailbox = $_
    Get-PublicFolder -Recurse | ForEach-Object {
       Add-PublicFolderClientPermission -Identity $_.name -AccessRights None -User $Mailbox.DistinguishedName
   }
}


Is that what you're after? Seems like it will catch a bit too much (adds everyone to every public folder).

Chris
Random Solutions  
 
programming4us programming4us