PublicFolder 2007
Hello,
I am using exch 2007
When I run the shell command:
AddUsersToPFRecursive.ps1 -TopPublicFolder "\Company" -User "graig" -Permission owner
Confirm
Are you sure you want to perform this action?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
A warning appears asking me if I want to perform this action.
How could I force the "yes to all" ? Because once I run the command and select "A" the message comes back like 30 times..
Thanks to all in advance.
Graig
August 20th, 2010 2:00pm
at the end add: -confirm:$false
I would suggest using ExFolders to manage permissions for Public Folders...very easy to propagate permissions:
http://msexchangeteam.com/archive/2009/12/04/453399.aspx
Tim Harrington - Catapult Systems - http://HowDoUC.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
August 20th, 2010 4:25pm
Here is my solution - I ran into this exact same issue.
If you don't have an Exchange 2010 server to run the ExFolders app on, you can also edit (or better yet copy and modify) the AddUsersToPFRecursive.ps1 script to ignore confirmations. The existing script does not have the ability to pass -comfirm:$false
from the PowerShell command line into the script commands to bypass confirmations, however if you always want the "no confirmation" behavior you can copy the script and then modify two lines to get this functionality.
First create a copy of AddUsersToPFRecursive.ps1. I named my copy AddUsersToPFRecursiveNoConfirm.ps1.
Next open your new file and edit lines 133 and 136:
Change line 133 from:
$permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer
to:
$permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer -confirm:$false
Next change line 136 from:
add-PublicFolderClientPermission -identity $_.Identity -user $user -AccessRights $Permissions -server $_.OriginatingServer;
to: (note the re-location of the semi-colon at the end of this line)
add-PublicFolderClientPermission -identity $_.Identity -user $user -AccessRights $Permissions -server $_.OriginatingServer -confirm:$false;
Now run the new script you modified from the PS with the normal options, and the script will just power through the changes without requesting confirmation for each item. It's really important you double check your syntax. I generally run
it with the normal script first, make sure the options are correct and wait for the first confirmation to pop up, then stop the script and then modify the command to use the NoConfirm script instead. This isn't appropriate for all applications,
so make sure you understand the implications. I personally have 1000's of public folders/subfolders that we are not ready to migrate away from and need to modify PF permissions on 1000's of folders for new and old users regularly in my Exchange 2007
environment - so for us, this is a blessing. It still takes some time to run through the folders (one user change takes about 15 minutes for me), however it's better than 2 hours of pushing "Y" or "A" to confirm each change and much better than spending
about 10 hours modifying via Outlook...
Cheers.
John Fuchs, MCSE, CCNP Network Engineer Video Conference Engineer Wisconsin, USA
June 22nd, 2011 1:11pm
Thank you John, this was a life saver for me! I administrate thousand of public folders and am constantly adding/deleting permissions. I followed your instructions and my new script ran perfectly!!!
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 5:13pm