Run powershell through winexe/psexec
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
ubuntu powershell windows-server-2012 psexec
add a comment |
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
ubuntu powershell windows-server-2012 psexec
Did you try--interactive=1
and--system
? Managing Windows Powershell from Linux terminal
– phuclv
Nov 19 '16 at 5:07
add a comment |
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
ubuntu powershell windows-server-2012 psexec
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
ubuntu powershell windows-server-2012 psexec
ubuntu powershell windows-server-2012 psexec
edited Jun 21 '13 at 18:02
asked Jun 20 '13 at 3:31
javanix
2341821
2341821
Did you try--interactive=1
and--system
? Managing Windows Powershell from Linux terminal
– phuclv
Nov 19 '16 at 5:07
add a comment |
Did you try--interactive=1
and--system
? Managing Windows Powershell from Linux terminal
– phuclv
Nov 19 '16 at 5:07
Did you try
--interactive=1
and --system
? Managing Windows Powershell from Linux terminal– phuclv
Nov 19 '16 at 5:07
Did you try
--interactive=1
and --system
? Managing Windows Powershell from Linux terminal– phuclv
Nov 19 '16 at 5:07
add a comment |
4 Answers
4
active
oldest
votes
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
add a comment |
The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:
winexe -U "DomainPC-Name" //IP Address 'powershell.exe Get-Process'
add a comment |
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.
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
add a comment |
Winexe sounds quite outdated and does not state supporting Windows Server 2008 and newer versions of Windows.
PowerShell went open source, you can download Ubuntu 14.04 and 16.04 .deb
packages from GitHub:
https://github.com/PowerShell/PowerShell
After installing it you can remotely connect to the Windows Server 2012 machine with the Enter-PSSession
PowerShell cmdlet.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f609835%2frun-powershell-through-winexe-psexec%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
add a comment |
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
add a comment |
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
Try
winexe --interactive=1 --user<USER> --password <SERVER> //SERVER powershell.exe
edited Jun 20 '13 at 16:59
Der Hochstapler
67.3k49230284
67.3k49230284
answered Jun 20 '13 at 15:01
user2480011
465
465
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
add a comment |
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
That doesn't seem to make any difference.
– javanix
Jun 21 '13 at 17:58
add a comment |
The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:
winexe -U "DomainPC-Name" //IP Address 'powershell.exe Get-Process'
add a comment |
The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:
winexe -U "DomainPC-Name" //IP Address 'powershell.exe Get-Process'
add a comment |
The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:
winexe -U "DomainPC-Name" //IP Address 'powershell.exe Get-Process'
The easiest way is to run the command directly using single quote. For example listing the processes can be done as follows:
winexe -U "DomainPC-Name" //IP Address 'powershell.exe Get-Process'
edited Dec 16 '13 at 19:49
Kevin Panko
5,849113648
5,849113648
answered Dec 16 '13 at 19:31
VAM
1
1
add a comment |
add a comment |
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.
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
add a comment |
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.
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
add a comment |
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.
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.
answered Dec 26 '13 at 12:07
Marco
594
594
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
add a comment |
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
1
1
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
no, powershell is a console tool. It can be called from cmd just like bash
– phuclv
Nov 19 '16 at 5:08
add a comment |
Winexe sounds quite outdated and does not state supporting Windows Server 2008 and newer versions of Windows.
PowerShell went open source, you can download Ubuntu 14.04 and 16.04 .deb
packages from GitHub:
https://github.com/PowerShell/PowerShell
After installing it you can remotely connect to the Windows Server 2012 machine with the Enter-PSSession
PowerShell cmdlet.
add a comment |
Winexe sounds quite outdated and does not state supporting Windows Server 2008 and newer versions of Windows.
PowerShell went open source, you can download Ubuntu 14.04 and 16.04 .deb
packages from GitHub:
https://github.com/PowerShell/PowerShell
After installing it you can remotely connect to the Windows Server 2012 machine with the Enter-PSSession
PowerShell cmdlet.
add a comment |
Winexe sounds quite outdated and does not state supporting Windows Server 2008 and newer versions of Windows.
PowerShell went open source, you can download Ubuntu 14.04 and 16.04 .deb
packages from GitHub:
https://github.com/PowerShell/PowerShell
After installing it you can remotely connect to the Windows Server 2012 machine with the Enter-PSSession
PowerShell cmdlet.
Winexe sounds quite outdated and does not state supporting Windows Server 2008 and newer versions of Windows.
PowerShell went open source, you can download Ubuntu 14.04 and 16.04 .deb
packages from GitHub:
https://github.com/PowerShell/PowerShell
After installing it you can remotely connect to the Windows Server 2012 machine with the Enter-PSSession
PowerShell cmdlet.
edited Mar 27 '17 at 11:35
answered Mar 27 '17 at 11:30
Christophe
1,1901027
1,1901027
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f609835%2frun-powershell-through-winexe-psexec%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you try
--interactive=1
and--system
? Managing Windows Powershell from Linux terminal– phuclv
Nov 19 '16 at 5:07