Archive

Posts Tagged ‘Exchange 2010; Exchange 14; ILM 2007;’

Running into Throttling Limits on Exchange 2010 Powershell

February 7th, 2010 Comments off

image Credit to Brian Reid for this contribution. For those who run into issues with Exchange 2010 proisioning with the following error:

The extensible extension returned an unsupported error in MIIS.
The stack trace is:
"System.Exception: The following Error happen when opening the remote Runspace: System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. The system load quota of 1000 requests per 2 seconds has been exceeded. Send future requests at a slower rate or raise the system quota. The next request from this user will not be approved for at least 380697024 milliseconds. For more information, see the about_Remote_Troubleshooting Help topic.
   at ILM.Custom.Exch2010.Extension.IMAExtensible.IMAExtensibleFileImport.GenerateImportFile(String fileName, String connectTo, String user, String password, ConfigParameterCollection configParameters, Boolean fFullImport, TypeDescriptionCollection types, String& customData) in C:\ILM Development Resources\ILM.Custom.Exch2010.ExtensionVB\ILM.Custom.Exch2010.Extension\ExchExtensible.vb:line 263

Prior to the official Exchange 2010 support being launched we developed our own Exchange 2010 Management Agent that supports provisioning of mailboxes, contacts, DL’s etc. Additionally it supports importing mailbox stores and mailbox settings. We however run into errors when moving the configuration to QA. This relates to throttling limits placed on the amount of powershell executions that a user can conduct. Have a look at the article below from Brain that explains a way to get things running again as well as to increase the limits.

Exchange Server 2010 has the ability to limit user and administrative actions. But in testing this feature in a lab I set the default policy (which by default affects everyone, including the Administrator account) to a policy that stopped me undoing the policy again!

I ran Set-ThrottlingPolicy def* -PowerShellMaxConcurrency 1 -PowerShellMaxCmdletsTimePeriod 1000 -PowerShellMaxCmdlets 1 which had the effect of saying I could open one PowerShell session (that is okay – its my lab environment), run a single cmdlet (maybe a bit too low) and to run one cmdlet every 1000 seconds. I had not worked out that 1000 seconds is over 15 minutes.

The problem came two days later, starting Exchange Management Shell and connecting to the remote PowerShell endpoint obviously invokes more than one cmdlet. The second cmdlet is terminated, and so Exchange Management Shell cannot start – ever!

The error message I got was:

The WS-Management service cannot process the request. The user load quota of X requests per Y seconds has been exceeded. Send future requests at a slower rate or raise the quota for this user. The next request from this user will not be approved for at least Z milliseconds.

X is the value of PowerShellMaxCmdlets and Y is the PowerShellMaxCmdletsTimePeriod

So to fix I cracked open ADSIEdit – not to be done lightly, as it runs the risk of destroying the entire Exchange organization and Active Directory.

To fix this and reset the Throttling Policy connect to the Configuration Naming Context in ADSIEdit and navigate to CN=Global Settings,CN=organization name,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain. Open CN=Default Throttling Policy_guid and edit msExchPowerShellThrottlingPolicyState to read:

v~0~con~18~cmds~-1~per~-1~que~-1~excmds~-1

Once Active Directory replicates you will be able to run PowerShell cmdlets in Exchange Management Shell. The first cmdlet I would run would be one to ensure that you are back to the default policy just in case you made a mistake in ADSIEdit:

Set-ThrottlingPolicy def* -PowerShellMaxConcurrency 18 -PowerShellMaxCmdletsTimePeriod $null -PowerShellMaxCmdlets $null -PowerShellCmdletQueueDepth $null