I'm using Scripting Agent cmdlet extension to set the new mailboxes calendar permission with reviwer rights for default account and i'm having the below scriptingagentconfig.xml file which is not working.. help me on correcting the below
<?xml version="1.0" encoding="utf-8" ?><Configuration version="1.0"><Feature Name="MailboxProvisioning" Cmdlets="New-mailbox"><ApiCall Name="OnComplete"> if($succeeded) { start-sleep -s 10 Set-ADServerSettings -ViewEntireForest $true Set-MailboxFolderPermission -Identity $provisioningHandler.UserSpecifiedParameters["Alias"]':\Calendar' -User Default -AccessRights Reviewer }</ApiCall></Feature></Configuration>
I don't want the existing mailbox calendar permission changed, i want the change only on new mailboxes
WARNING: The cmdlet extension agent with the index 5 has thrown an exception in OnComplete(). The exceptionis: Microsoft.Exchange.Provisioning.ProvisioningException: ScriptingAgent: Exception thrown while invoking
scriptlet for OnComplete API: Cannot bind argument to parameter 'Identity' because it is null.. --->
System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter
'Identity' because it is null.
at System.Management.Automation.ParameterBinderBase.ValidateNullOrEmptyArgument(CommandParameterInternal
parameter, CompiledCommandParameter parameterMetadata, Type argumentType, Object parameterValue, Boolean
recurseIntoCollections)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter,
CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal
argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets,
CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets,
Collection`1 arguments, CommandMetadata commandMetadata)
at
System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collecti
on`1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1
arguments)
at System.Management.Automation.CommandProcessor.BindCommandLineParameters(CommandParameterInternal[]
parameters)
at System.Management.Automation.CommandProcessor.Prepare(CommandParameterInternal[] parameters)
at System.Management.Automation.CommandProcessorBase.DoPrepare(CommandParameterInternal[] parameters)
at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input,
Hashtable errorResults, Boolean enumerate)
--- End of inner exception stack trace ---
at Microsoft.Exchange.ProvisioningAgent.ScriptingAgentHandler.OnComplete(Boolean succeeded, Exception
e)
at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnComplete(Task task, Boolean succeeded, Exception
exception)