Random failures of Test-Path using Invoke-Command and double-hop remoting - by DMANCE

Status : 


Sign in
to vote
ID 782978 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 4/4/2013 6:02:41 AM
Access Restriction Public


Environment: Powershell V3.0, WinRM 3.0 on Server 2012/2008 R2 domain network.

I've noticed failures in Test-Path in our application that may be related to double-hop but they are strangely random and related to timing/delays in execution.

I am running the script on System-1(server 2008), Remoting to System-2(server 2008) using Invoke-Command and then querying and accessing known files on System-3(server 2012). Test-Path fails randomly in this case. This attached file sample script loops an arbitrary 20 times since the problem occurs after some number of iterations of the loop. The problem goes away if you set the $fname variable to the local access file (local to System-2). The problem also goes away if you remove the intervening simple access to the file (dir $fname) !!! And if you wait seconds between running the script, the results vary.

I have set all WinRM settings to adjust for Maximum sessions/connections. I've read every blog and tried about anything I can think of. Credentials are fine. I have not tried this with WinRM 2.0.

The WinRM3.0 patch for Server 2008 is reported to be problematic - but due to the timing quirks it seems like remote sessions created by Invoke-Command are persistent and failures are occurring when I hit against the quota for connections.

Sign in to post a comment.