Tuesday, October 2, 2018

Check machine status via powershell command

<#$ok = Test-Connection '10.19.999.99' -Count 1 -Quiet #> <# some crappy ip #>
$ok = Test-Connection '10.19.193.29' -Count 1 -Quiet <# actual ip #>
if (-not($ok)) {
'Machine is down' } else { 'All good' }

No comments:

Post a Comment