by pnathan · 13y ago · 0 comments
For instance, a key problem I had in a prior gig was that I needed to automatically log into a Windows machine, run a job, and then log out. Pretty bog standard; didn't need careful error recovery or anything particularly sophisticated.
In Linux, you configure your SSH keys, then ssh automatedjob@server -c "./run-my-thing", and that's that. I literally could not find any identical analog in Windows besides telnet (if anyone knows of a solution here that approximates the Linux one for simplicity, I'd love to know about it). Today I'd probably just requisition a copy of a Windows SSH server and be done with the sorry mess. Better yet, throw Windows out and go full Linux. ;-)
He is also priming out infrastructure for Desired State Configuration (configuration management (like Puppet/Chef) for Windows).
I'm glad its working for you, I use stackexchange daily and am generally quite happy with it!
That I was hired as a Windows specialist was so that we can go deeper on the OS side and the PowerShell side, just as we have a Linux expert to go deeper on the Linux side. Our sysadmin team was just more tilted with experience on the Linux side (though you wouldn't know it - as almost everyone I work with would qualify as a senior admin in any Windows shop in the world).
Thank you for your response.
I am glad to see that there are comparable capabilities in the modern Windows world and will dig into the WMI side of things next time Windows admin tasks come up.
Now, I was pretty sure you could use WMI to do this, and looking around I found this -
http://4sysops.com/archives/three-ways-to-run-remote-windows...
and this
http://blog.commandlinekungfu.com/2009/05/episode-31-remote-...
Remote PowerShell is probably 'the way' Microsoft will be pushing now
http://msdn.microsoft.com/en-us/library/windows/desktop/ee70...
What was happening is that there was a job controller running on Linux that needed to contact the Windows machine and boot the job into action. One solution would have been to install a Jenkins slave instance, which turned out to be the solution eventually adopted.
[1] It's been a few years since I studied this, but it was a known issue in '08/09 or so.
Also, iirc, using the psexec interface from Linux in a Linux->Windows connection does not work (a wrinkle in the original story is that it was a Linux->Windows connection).
Supposing that a keyfile is copied, the multiplicity of ssh files limits the damage.
I seem to remember doing clever things with WSI for just such a thing curiously I am pretty sure there will be examples of both on StackOverflow ;-)
Edit : oh yes WMI and psexec - amazing how quickly things drop out of your brain.
We've developed approach using Chef that spans Linux and Windows boxes.
To log in and run some script on Windows boxes, we use WinRM, which is integrated with Chef knife tool and works almost as well as SSH.
* Set the firewall to only allow telnet access on a private subnet
* Set the vpn connection to use that subnet
* login from any computer that supports telnet and PPTP.