Exchange 2010 - suddenly getting errors trying to run scripts
This is a test snipped from a script that has run successfully in the past. Get-Mailbox -ResultSize unlimited -OrganizationalUnit ("ou=bk001,ou=cbc users,dc=cbc,dc=cts") | ?{$_.customattribute9 -ne "001 Users"}| %{ write-host "setting $_" set-mailbox $_ -customattribute9 "001 Users" } Suddenly this morning, for every mailbox it finds and tries to set the customattribute on, I get the following error, twice per mailbox: Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently. + CategoryInfo : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [], PSInvalidOperationException + FullyQualifiedErrorId : RemotePipelineExecutionFailed I get the same results running from a workstation or from the EMS on one of the Exchange servers. Anyone else seen this? [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
July 30th, 2010 10:43am

More information: We're in the middle of a 2007 - 2010 migration. The problem only seems to occur on mailboxes that are still on the 2007 Exchange servers. The pipleline script works on mailboxes that have been migrated to 2010. This does work on the 2007 mailboxes: $mbxs = Get-Mailbox -ResultSize unlimited -OrganizationalUnit ("ou=bk001,ou=cbc users,dc=cbc,dc=cts") | ?{$_.customattribute9 -ne "001 Users"} foreach ($mbx in $mbxs){ write-host "setting $($mbx.displayname)" set-mailbox $mbx -customattribute9 "001 Users" } But trying to use set-mailbox in the pipeline fails. One thing that has changed since the last time I tried this, is that I deleted an empty Servers container in a legacy Administrative Group, per a recommendation on the Exchange Team blog to fix a problem with mail delivery to public folders. [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2010 11:12am

Never mind. If found this from here: http://technet.microsoft.com/en-us/library/dd351136.aspx Apparently it works sometimes, and other times not so much. Error When the ForEach Cmdlet Is Used in a Pipeline and Cmdlets Are Used in its Script Block You might get the following error message when you use the ForEach cmdlet in a pipeline and the following circumstances are true: The ForEach cmdlet accepts data from a cmdlet earlier in the pipeline. The script block on the ForEach cmdlet contains a cmdlet. This error is caused because the Windows PowerShell remoting feature doesn't support more than one pipeline running at the same time. To resolve this issue, store the output of the cmdlet earlier in the pipeline in a variable, and then pipe the data stored in the variable to the ForEach cmdlet. This example results in a concurrent pipeline error. Copy Code Get-Mailbox | ForEach { Set-Mailbox -ProhibitSendReceiveQuota 3GB } The following error message is generated. Copy Code Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently. + CategoryInfo : OperationStopped: (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [], PSInvalidOperationException + FullyQualifiedErrorId : RemotePipelineExecutionFailed To resolve the error, store the output of the Get-Mailbox cmdlet in a variable, and then pipe the variable to the ForEach cmdlet, as shown in this example. Copy Code $Mailboxes = Get-Mailbox $Mailboxes | ForEach { Set-Mailbox -ProhibitSendReceiveQuota 3GB } [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
July 30th, 2010 11:37am

Thanks for posting your findings, very helpful to me.
Free Windows Admin Tool Kit Click here and download it now
October 19th, 2011 5:16am

Indeed helpful. Thanks.
September 11th, 2012 2:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics