Accueil > Windows > Pinger un ordinateur avec un script Powershell.

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."
Categories: Windows Tags: , ,

Vous avez aimé cet article ? Alors partagez-le en cliquant sur les boutons ci-dessous :

Twitter Facebook Google Plus Linkedin

Article rédigé par Christophe Bluteau.

  1. 25/11/2016 à 19:31 | #1

    That insight’s perfect for what I need. Thanks!

  2. 27/03/2017 à 15:12 | #2

    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

  3. 24/12/2017 à 09:02 | #3

    You should take part in a contest for one of the highest quality blogs on the net.
    I most certainly will highly recommend this web site!

  4. 03/01/2018 à 05:35 | #4

    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.

  5. 19/03/2018 à 11:07 | #5

    I am genuinely glad to read this webpage posts which carries
    plenty of useful information, thanks for providing these statistics.

  1. Pas encore de trackbacks