I don't know if this or Server Fault is the best place to put this question. I'm going to put it here since the method I'm describing is being launched via a PHP script.
I want to remotely check from one machine on a network, whether another machine on that network is a windows machine or a linux machine. I know the login information of the target machine.
I'm using proc_open in PHP to run plink to launch the ls command. This is cross platform (which I want) because there's a windows and a linux plink. If it succeeds and I get an output then the machine is a linux machine. If it fails then I assume its windows. I can safely assume that the windows machines aren't running OpenSSH in cygwin.
The problem is that on some windows machines, the timeout before it fails against a windows machine takes FOREVER. I need something a little quicker that is still reliable and is easy to just put into a script. Can anyone think of anything equivalent?