maxime12345

Untitled

Apr 1st, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Host de départ
  2. $host_n = 1
  3.  
  4. #Test de la plage 1 à 254
  5. while($host_n -le 254)
  6. {
  7.     # 1 ping sur l'ip et conversion du resultat en true/false
  8.     $ping = Test-Connection 192.168.1.$host_n -count 1 -quiet
  9.  
  10.     #Si ping = true, afficher l'IP
  11.     if($ping -match "True")
  12.     {
  13.         Write-Host "192.168.1.$host_n"
  14.     }
  15.  
  16.     $host_n++
  17. }
Advertisement
Add Comment
Please, Sign In to add comment