Pinger un ordinateur avec un script Powershell.

Faire un ping d’un ordinateur.
Permet vérifier que l’ordinateur est en ligne avant de lancer une action sur lui via un script.

$computername = Read-Host "Please enter the computer name"
$ping = new-object System.Net.NetworkInformation.Ping
$reply = $ping.send($computerName)
if ($reply.status –eq “Success”)
{
write-host "$ComputerName is online."
}

5 réflexions sur « Pinger un ordinateur avec un script Powershell. »

  1. http://www.florida912groups.com/

    You're an optimist, Delaware Watch.I think we've pretty much doomed all higher (multi-cellular) living things to extinction and will ultimately leave behind a planet utterly contaminated by deadly levels of radioactivity.Evolution cannot happen when genes are constantly bombarded by radiation. Perhaps some single cell creatures living deep beneath the earth will eventually emerge to begin the evolutionary process again after the millions of years that will be required for the radioactive isotopes like plutonium to disappear.Have a good day.anonone

    Répondre
  2. https://chungcu89phunghung.net/

    It is climbing the ladder of inflation, and can no longer be referred to as an affordable substitute for
    purchasers. If you are buying a rental in Mumbai the first time then it’s preferable to seek aid of a realtor who will show you about the same process.
    If you have a buddy or neighbor that’s thrilled to have their number provided being
    an emergency contact that can be a great benefit.

    Répondre

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *