Wednesday, 7 December 2016

Powershell scrip to test connectivity of a remote server


$SERVER_NAME = "127.0.0.1"



function TestConnection($SERVER_NAME)
{
   
    $Conn1 = Test-Connection -ComputerName $SERVER_NAME -Count 1 -ea 0
    if($? -eq "true")
    {
        "success"
    }
    else
    {
      "faliure"
    }
}

TestConnection $SERVER_NAME

No comments:

Post a Comment

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...