Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Ping & RDP status

$
0
0

Hi,

I have a little script that indentify the ping status of servers:

get-content c:\servers.txt | foreach { if (test-connection $_ -quiet) { write-output "$_ is Pingable" | out-file c:\results.txt -append } else {write-output "$_ is down" | out-file c:\results.txt -append}}

No problem with this | but somehow would like to check RDP status (put RDP results the same output file) that I can log on to, of course, only to pingable servers. I am checking the RDP status manually, is it possible? any idea would be appreciated.. I know I am too lazy, but  PS script can solve this. :)


Viewing all articles
Browse latest Browse all 10624

Trending Articles