Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to connect to a Windows 2012 server from Ubuntu.

winexe --user <USER> --password <SERVER> //SERVER cmd.exe 

works just fine.


winexe --user <USER> --password <SERVER> //SERVER powershell.exe`

just hangs.

It displays:

Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

but after that it just hangs and won't respond to keypresses.

Is there a parameter I need to pass to powershell to get it to run in interactive mode or anything?


If I run the above command through strace, it seems to be waiting for the server to send something back.

epoll_wait(4, {}, 1, 10)                = 0
epoll_wait(4, {}, 1, 10)                = 0
epoll_wait(4, {}, 1, 10)                = 0
share|improve this question


winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe

share|improve this answer
That doesn't seem to make any difference. – javanix Jun 21 '13 at 17:58

The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:

winexe -U "Domain\PC-Name" //IP Address 'powershell.exe Get-Process'
share|improve this answer

Powershell seems a "Windows Gui Program", which tries to interact with the desktop. Obviously this is not possible, if connected from remote (maybe in Windows XP). To be interactive and connect the input of the powershell to stdin use "-Command -".

Which lets the powershell interact with stdin. You can type commands and see the output, but you do not get the prompt from powershell.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .