Run powershell through winexe/psexec
7,204
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
Related videos on Youtube
Comments
-
javanix over 1 year
I'm trying to connect to a Windows 2012 server from Ubuntu.
winexe --user <USER> --password <SERVER> //SERVER cmd.exe
works just fine.
However,
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?
EDIT
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
-
phuclv over 7 years
-
-
javanix almost 11 yearsThat doesn't seem to make any difference.
-
phuclv over 7 yearsno, powershell is a console tool. It can be called from cmd just like bash