I've been asked to change the way I update calendar permissions for new mailboxes so that permissions are set "on-create" rather than via a nightly script.
So I enabled the scripting agent and I came up with
<?xml version="1.0" encoding="utf-8" ?><Configuration version="1.0"><Feature Name="MailboxProvisioning" Cmdlets="new-mailbox"><ApiCall Name="OnComplete"> if($succeeded) { $newmailbox = $provisioningHandler.UserSpecifiedParameters["samaccountname"] Set-MailboxFolderPermission -User "Default" -AccessRights Reviewer -Identity $newmailbox":\Calendar" }</ApiCall></Feature></Configuration>
However it errors out each time it runs. What am I missing here?