Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winexe gets stuck in some remote servers #2

Open
amrithgnair opened this issue Aug 31, 2017 · 1 comment
Open

winexe gets stuck in some remote servers #2

amrithgnair opened this issue Aug 31, 2017 · 1 comment

Comments

@amrithgnair
Copy link

I want to be able to create a timeout such that the winexe stops executing in the remote server and returns control back to shell where it was initiated:
for more details:
https://www.experts-exchange.com/questions/29053524/timeout-for-a-command-running-from-linux-to-windows.html

I am trying this:

x=winexe -U user%pwd //vservername 'powershell.exe Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfLogicalProcessors'

In some systems the command gets stuck in the remote system and does not come back, I would like to add a timeout to the above command, I tried this

x=timeout 10 winexe -U user%pwd //vservername 'powershell.exe Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfLogicalProcessors'

but does not work.

Please help

@amrithgnair
Copy link
Author

I also tried this, but when command is successful value of z is not set:

z=winexe -U domain/user%pwd //vservername 'cmd /C powershell.exe "Get-WmiObject Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfLogicalProcessors"' & sleep 5;kill $!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant