The cmdlet extension agent cannot process multiple objects in a pipeline in an Exchange Server 2010 environment

Article ID: 2589982 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

Consider the following scenario:
  • You enable the Scripting Agent cmdlet extension agent in a Microsoft Exchange Server 2010 environment.
  • A script is configured to contain an OnComplete handler. 
  • You add the script to a configuration file.
  • You run a cmdlet to process multiple objects in a pipeline by using the Exchange Management Shell.
In this scenario, the cmdlet extension agent fails after it processes the first object. Additionally, you receive the following error message in the shell:
WARNING: The cmdlet extension agent with the index Number has thrown an exception in OnComplete(). The exception is: 
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Exchange.Configuration.MonadDataProvider.MonadCommand.set_CommandType(CommandType value)
at Microsoft.Exchange.ProvisioningAgent.ScriptingAgentHandler.OnComplete(Boolean succeeded, Exception e) at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnComplete(Task task, Boolean succeeded, Exception exception)

CAUSE

This issue occurs because the OnComplete handler incorrectly sets the powershell connection to null before all commands in the pipeline are processed. This causes an access violation when subsequent commands in the pipeline are executed.


RESOLUTION

To resolve this issue, install the following update rollup:
2645995 Description of Update Rollup 1 for Exchange Server 2010 Service Pack 2

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about cmdlet extension agents, visit the following Microsoft website:
General information about cmdlet extension agents
For more information about the Scripting Agent cmdlet extension agent, visit the following Microsoft website:
General information about the Scripting Agent cmdlet extension agent
For more information about how to manage cmdlet extension agents, visit the following Microsoft website:
General information about how to manage cmdlet extension agents

For more information about the Enable-CmdletExtensionAgent cmdlet, visit the following Microsoft website:
General information about the Enable-CmdletExtensionAgent cmdlet

For more information about the pipelining in the Exchange Management Shell, visit the following Microsoft website:
General information about the pipelining

Properties

Article ID: 2589982 - Last Review: February 13, 2012 - Revision: 1.0
APPLIES TO
  • Microsoft Exchange Server 2010 Service Pack 2, when used with:
    • Microsoft Exchange Server 2010 Enterprise
    • Microsoft Exchange Server 2010 Standard
Keywords: 
kbqfe kbfix kbexpertiseinter kbsurveynew KB2589982

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com