-
Notifications
You must be signed in to change notification settings - Fork 52
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
WS-Man Send operation implemenation #53
Comments
That's a very interesting idea @semancik. Definitely will look into adopting the code. It also ties nicely with a cleanup of the API I have in the works. |
Hey @semancik. It's been some time, but I finally got around to integrating your suggestion. The result is in PR #66. I've successfully tested it with a Windows 7 machine. There's a problem when running against Windows Server 2012 though. It's not taking any input. I've been able to replicate the problem with the windows' The functionality is really useful, but if I can't get it to work on recent windows versions, then don't think it's worth including it in the Any ideas what could be causing the problem? |
I've got my version working very successfully on Windows Server 2012R2. Tested on several servers, different configurations. Seems to work well, even with CredSSP and long running powershell processes. I haven't tested your version yet. I'm afraid that I'm no windows expert or Microsoft fan. I have implemented this piece of ... ehm ... technology purely out of desperation. Therefore I have absolutely no idea what might be wrong in your case. I'm sorry. |
That's useful to know, thanks. |
I can confirm that both CredSSP and Send operation work on both Win2008 and Win2012. However for CredSSP to work on Win2008 an improved CredSSP implementation in HTTP client is needed: |
@semancik care to share what tool you use to test the async input with? I've been using variations of |
@semancik I'm testing your branch against my vagrant Windows 2012R2 box. Here's the test I'm using. Is that how the API is supposed to be used? What I'm seeing is that execution blocks on the
If that works for you can you also try the testCustomStreams test in #66? |
Once again I'm quite tight with available time. I'm sure that the code in my fork works. However, haven't had time to try any code from master yet. I'll have to find the time to put all this together later. I'm really sorry for this mess, but I cannot find the time now. |
I have implemenation of the Send WS-Man operation. The code is here:
https://github.com/Evolveum/winrm4j/tree/shell
This operation can be used to send input to the running process. With a proper PowerShell magic it can be used to initialize PowerShell once and then send several commands to an initialized instance. I have also added support for semi-async execution of commands, so winrm4j can continuously receive command output and send input as the command executes.
This is usually needed for Exchange scripts unless you want to suffer terrible penalty of exchange snap-in intialization. The sample code is here:
https://github.com/Evolveum/playground/tree/master/powerhell
However, I'm not going to create a pull request now. The code is a follow-up to my CredSSP changes which are now stuck:
#49
So I'm writing this as a note to anyone who would need the implementation of Send operation. Please go ahead and use the code from my fork.
The text was updated successfully, but these errors were encountered: