Tuesday, 26 March 2013

Tips - How to set reviewer permission for default account on New Mailboxes - Exchange 2010

Lot of companies want to allow all users in the company to access others calendars. But the default account will have the permission to see only the free busy (Availability option of others calendars. To accomplish this, we need to change the Default account to have reviewer permission on all users Calendars. Exchange administrator can change the default permission from Availability only to Reviewer permission using the below script.

$mailbox = Get-Mailbox –ResultSize unlimted
foreach($user in $Mailbox) {
$calendar = $User.alias+”:\Calendar”
Set-MailboxFolderPermission -Identity $calendar -User ‘default’ -AccessRights Reviewer }

Above script will set the default account to have reviewer permission on exiting mailbox. You may look for option to automate this task of setting the reviewer permission on new mailbox calendars for the default account. This can be implemented using the scripting agent option in Exchange Server 2010.
Scripting Agent Config: Scripting Agent Config is an option on Exchange Server 2010 which will allow you to automate an exchange task when something occurred on Exchange Server. It is a configuration file which will have to settings to automate a task. Below shows a content of the Scripting Agent Config file


<?xml version=”1.0″ encoding=”utf-8″ ?>
<Configuration version=”1.0″>
<Feature Name=”MailboxProvisioning” Cmdlets=”New-mailbox”>
<ApiCall Name=”OnComplete”>
if($succeeded) {
}
</ApiCall>
</Feature>
</Configuration>

Short explanation on the above xml file


Below shows the steps on how to implement it

Step 1: Create a ScriptingAgentConfig xml file and place that file on the CmdletExtentionAgent folder

Open a Notepad and copy the below content and save it as ScriptingAgentConfig.xml file on this location C:\Program Files\Microsoft\Exchange Server\V14\Bin\CmdletExtensionAgents
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Configuration version=”1.0″>
<Feature Name=”MailboxProvisioning” Cmdlets=”New-mailbox”>
<ApiCall Name=”OnComplete”>
if($succeeded) {
Set-ADServerSettings -ViewEntireForest $true
$mailbox = Get-Mailbox
foreach($user in $Mailbox) {
$cal = $User.alias+”:\Calendar”
Set-MailboxFolderPermission -Identity $cal -User Default -AccessRights Reviewer
}}
</ApiCall>
</Feature>
</Configuration>

Above scriptingAgentConfig.xml file needs to be copied to all your Exchange 2010 Servers. If not you will get an error message.


Step 2: Enable the Scripting Agent option
 
Open Exchange Management Shell and type the below shell command to enable scripting agent
Enable-CmdletExtensionAgent “Scripting Agent”
To confirm whether “Scripting Agent” is enabled, run the below shell command and check Scripting Agent has to be set to ‘True’



Step 3: Test the function

Create a new Test mailbox and on the completion of mailbox creation, run the below shell command to see whether the default account has reviewer permission.
Get-MailboxFolderPermission –Identity TestMailbox:\Calendar –User Default



Note: I have tested the above and it is working for me. I’m leaving this with you to take responsible if any issue occurred in your environment. If you need any assistance, please get back to me.

No comments:

Post a Comment