Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a powershell command which runs in TeamCity. When I try to run a batch file remotely using psexec from this .ps file, I see once the remote execution started, nothing happens. I tried several ways discussed in multiple forums but of no use.

Main.ps:

Invoke-Command -ScriptBlock {C:\PSInstall.bat}

PSInstall.bat:

C:\Tools\psexec.exe -i -d "\\server2" -u "domain\admin" -p "abcd" -f -w cmd "C:\Install.bat"

My Build log:

[11:32:02]C:\BuildAgent\work\603cfc01a3fe22bb\Tools>C:\Tools\psexec.exe -i -d "\\server2" -u "domain\admin" -p "abcd" -f -w cmd "C:\Install.bat" 
[11:32:02]
[11:32:02]PsExec v1.98 - Execute processes remotely
[11:32:02]Copyright (C) 2001-2010 Mark Russinovich
[11:32:02]PsExec executes a program on a remote system, where remotely executed console
[11:32:02]Sysinternals - www.sysinternals.com
[11:32:02]applications execute interactively.

I am stuck at this point with no clue what's happening, any help is highly appreciated. I have set EULA already on the remote machine.

share|improve this question
    
If you run the commands directly from powershell (forgetting TeamCity for now), what happens? Does it work ok? –  Chris Feb 11 '13 at 23:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.