you could use this code:
<?php $resLogin = exec('tasklist /fi "ImageName eq login-server.exe"'); if($resLogin != 'INFO: No tasks are running which match the specified criteria.') { echo $resLogin; }?>
I'm working on it, so if you want, I can send the rest of my code when I'll finish it!