PS Remoting - Failed to connect to an IPC port: Access is Denied
I am trying to configure some deployment steps in our build process. This involves using powershell to remotely execute MSTEST.EXE. The remoting works fine for things like {Get-Process} or writing a file to the remote local drive. However, MSTEST fails with the following error:

Failed to connect to an IPC port: Access is Denied

The account that powershell runs under is a domain account, and is a local admin on both the local and remote boxes.

Script looks like:
==================
invoke-command -computername BUILD01 -scriptblock {
d:
cd "D:\BuildDrop\Testing_20091210.4"
$exe = "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe"
$vsmdi = "D:\BuildDrop\Testing_20091210.4\Release\WebTests\MyProject.Tests.vsmdi"
& $exe /testmetadata:$vsmdi /testlist:AllWebTests

}
===================

I've tried using the -Credential option too, but that made no difference. I'm not sure what security to tweak where to fix this error.

Suggestions?
December 10th, 2009 7:10pm

Somewhat related:
http://www.ureader.com/msg/167336.aspx
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2009 2:37am

Thanks Marco, I saw that too, although it hasn't helped me to track down the issue.

It appears the issue is with MSTest, and not powershell alone.

If I run MStest using the SysInternals PsExec tool, it fails with the same error message.
December 11th, 2009 6:48pm

Hi,

What about the following suggesions?

http://social.msdn.microsoft.com/Forums/en/netfxremoting/thread/9bcb3ac6-8603-4dd6-b558-37642a488137

Thanks.
Free Windows Admin Tool Kit Click here and download it now
December 14th, 2009 10:27am

Thanks. Looked into that, but can't find a similar config for MSTest.

The example seems to be more for coding your own remoting components, when you have control over both the client and server.

In my case, I'm not writing my own, just trying to use powershell, or PsExec.
December 15th, 2009 4:18pm

Sorry, do you still need help here?  Have you gotten it to work?
Free Windows Admin Tool Kit Click here and download it now
March 1st, 2010 6:15pm

Well, yes and no.  I never did get it to work.

As a work around, I used powershell to write an event log entry on the remote box that runs MSTest.  Then, on that box, I configured a scheduled task that is triggered by the event log entry, to run a powershell script that executes MSTest locally instead.

It is a bit of a hack, but seems to work.  I would be interested to know why the documented methods above failed.
March 1st, 2010 10:22pm

http://blogs.technet.com/operationsmgr/archive/2009/08/27/opsmgr-2007-event-id-29106-failed-to-connect-to-an-ipc-port-access-is-denied.aspx

OK, so you said you're using a domain account to call this.  Last thing I can think of: Are you running your PowerShell session with elevated privileges ("Run As Administrator")?

Else, I wish I had more advanced debugging skills to suggest something else...
Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2010 12:36am

Hi Marco,

I have the same problem. I invoke the mstest on a remote machine via invoke-command in PowerShell to execute some dummy test case which only trys to create a file and write something to it. But it failed, saying that "Failed to connedct to an IPC Port: Access is denied". Here is exactly how I did it:

PS C:\Windows\system32> Invoke-Command -computername <remote server name> -scriptblock { C:\ExecutionTools\mstest\mstestshim.exe /testcontainer:c:\o
netest.dll /test:UnitTest1 } -authentication credssp -credential <my credential, which is in administrators group on the remote server>.

 

Thanks,

Hongbo

October 27th, 2010 10:42pm

Hi Marco, Hongo - Did this ever work for you? 

I am getting exact same issue.

Thanks,

Himanshu

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2012 3:22am

Hi Marco,

After so many years passed, has anyone worked around this? I've got the same problem here. 

-Jingfei

June 26th, 2015 3:15am

Hi Marco,

After so many years passed, has anyone worked around this? I've got the same problem here. 

-J

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 4:51am

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

Other recent topics Other recent topics