removing nic team causes powershell to hang

Welcome Forums General PowerShell Q&A removing nic team causes powershell to hang

Viewing 0 reply threads
  • Author
    • #5726
      Topics: 1562
      Replies: 0
      Points: 1
      Rank: Member

      by willbs at 2013-03-27 08:14:23

      i am performing a test where i have to remove the NIC team on a UUT, here is the command

      psexec \\$global:uutName -u \$global:DiskPartusername -p $global:password cmd /c ‘echo . | "C:\Program Files\intel\dmix\cl\prosetcl.exe" "Team_Remove" "1" ‘

      when this command runs, the team is removed but the nics are disabled momentarily and the command hangs and the only way to get the command prompt is to do a ctrl-break manually

      i thought of running the command as a job, i do get the command prompt back but the command doesn’t remove the team for some reason

      start-job -name RemoveTeam -scriptblock {psexec \\$global:uutName -u \$global:DiskPartusername -p $global:password cmd /c ‘echo . | "C:\Program Files\intel\dmix\cl\prosetcl.exe" "Team_Remove" "1" ‘ }

      is there a trick? what am i missing? how can i get the command to run and get the command prompt?

      the same thing happens when i create a team

      psexec \\$global:uutName -u \$global:DiskPartusername -p $global:password cmd /c ‘echo . | "C:\Program Files\intel\dmix\cl\prosetcl.exe" "Team_Create" "1,2" "NewTeam" "AFT" ‘

      by DonJ at 2013-03-27 08:44:29

      I’m not sure this is PowerShell… I think this may be Psexec losing its connection. Is the behavior different if you do it from Cmd.exe instead?

      Start-Job I could not have expected to change anything. It’s still running the command locally, and Psexec is managing the connection.

      by MasterOfTheHat at 2013-03-27 08:49:40

      I would guess you are losing the console because psexec is losing it’s connection to the remote machine before it can finish the prosetcl.exe job. I would expect psexec to eventually fail, though. Does it stay in that state indefinitely?

      by willbs at 2013-03-27 09:31:26

      to don j, i think your right
      if i run this command from the local cmd, not the uut cmd

      psexec \\stg-xx -u \Administrator -p Testxxxx cmd /c ‘echo . | "C:\Program Files\intel\dmix\cl\prosetcl.exe" "Team_Remove" "1"’

      i get the error "the system cannot find the path specified"

      to masterofthehat
      as far as i can tell it stays there indef

      again, when i run as a command, the remove team happens but command propt hangs
      if i run as job, the remove team doesn’t happen but i get the command prompt

      is there a way to force the command prompt when i run as a command? some kind of timer if statement?

      by DonJ at 2013-03-27 09:38:57

      I think your ultimate problem is that Psexec doesn’t like to be treated like this ;). You’re going to have to either solve that, or find a way to do this that doesn’t involve Psexec.

      by willbs at 2013-03-27 09:49:53

      LOL that’s why i asked you guys, i’m hoping you might have an answer/work around/trick

      by DonJ at 2013-03-27 10:23:06

      Set the command up as a batch file on the machine, and schedule it to run with Scheduled Tasks, instead of running it interactively. Then you’re not depending on Psexec.

      by willbs at 2013-03-27 15:31:42

      thanks don, that’s a good idea
      i was able to figure it out how to keep it from hanging
      there is a -d option (when in doubt, re-read the instructions a bunch of times) "Don’t wait for application to terminate. Only use this option for non-interactive applications"

      psexec -d \\$global:uutName -u \$global:PSexecusername -p $global:password cmd /c ‘echo . | "C:\Program Files\intel\dmix\cl\prosetcl.exe" "Team_Remove" "1"’

      the team is removed and i get the control prompt back, same would be with team_create command shown above

Viewing 0 reply threads
  • The topic ‘removing nic team causes powershell to hang’ is closed to new replies.