Laeeq Qazi's Exchange Server Blog

Exchange Server blog

Cannot invoke pipeline because runspace is not in the Opened state

Hi

I developed a web app to manage exchange server 2010 objects (domains, mailboxes etc) using Remote PoewerShell API. When deployed this web app on an other fresh server with Exchange Server 2010 installed, I got this error:

Cannot invoke pipeline because runspace is not in the Opened state. Current state of runspace is ‘Broken’.

The user, which I was using for Remote PowerShell credentials, was a domain admin, with all  sorts of rights, so I looked into basic RemotePowershell configuration, and found the solution.

I followed these 2 steps to resove this error:

1. Enabled Powershell remoting on server. Open Windows PowerShell console and run

    Enable-PSRemoting

It would prompt you for input, and then just press ‘Enter’, 2 times.

2. Go to IIS manager, and under default website, locate Exchange ‘PowerShell’ virtual directory. On right side pane,  double click “Authentication” and enable “Basic” authentication.

Dont forget to reset IIS by Start->Run-> IisReset.

These 2 steps resolved my error. I would also suggest to look for 3rd step, which is to check whether the user, which you are using for Remote PowerShell credentials, has the “RemotePowerShellEnabled” flag enabled or not, which you can check via Exchange Management Shell on Exchange server by running:

get-user domain\User|fl RemotePowerShellEnabled

If it returns false, then enable it by using

set-user domain\User-RemotePowerShellEnabled:$True

Hope this help someone else too.

Kind Regards,

Laeeq Qazi

Advertisements

January 3, 2013 - Posted by | Exchange 2010, Exchange 2013

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: