SUPINFO International University

SUPINFO Institute of Information Technology
Laboratoire Microsoft




Test si un ordinateur est sur le réseau ou non

Accueil > Script > maintenance > Test si un ordinateur est sur le réseau ou non

Test si un ordinateur est sur le réseau ou non

Par Nicolas MILBRAND, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 09/03/2005 vers 17h.

Description :
Ce script VBS permet de tester si un ordinateur est sur le réseau.

Script :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPingedComputers = objWMIService.ExecQuery _
("Select * from Win32_PingStatus Where Address = 'Addresse IP de l'ordinateur'")

For Each objComputer in colPingedComputers
If objComputer.StatusCode = 0 Then
Wscript.Echo "L'ordinateur est sur le réseau"
Else
Wscript.Echo "L'ordinateur n'est pas sur le réseau."
End If
Next



Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
6

Visites :
13282

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft