Tiens un script qui fait ca, effectue un ping sur la machine 'client1' si elle repond balance un msg et ne fais rien, si elle ne repond pas balance un msg et envoit un email.
seul requirement, installer le service smtp sur la machine ou le script est executer et renseigner un serveur mail valide sur le reseau.
c'est juste a titre d'exemple, il faut le modifier a ca convenance sachant qu'on peut rajouter tout ce qu'on veut la dessus.
Code :
- On Error Resume Next
- strComputer = "client1"
- Set objShell = CreateObject("WScript.Shell" )
- Set objScriptExec = objShell.Exec("ping -n 2 -w 1000 " & strComputer)
- strPingResults = LCase(objScriptExec.StdOut.ReadAll)
- If InStr(strPingResults, "reply from" ) Then
- Wscript.Echo strComputer, "online"
- Else
- Wscript.Echo "Unable to connect to " & strComputer
- Set objEmail = CreateObject("CDO.Message" )
- objEmail.From = "test@test.local"
- objEmail.To = "test@test.local"
- objEmail.Subject = "subject msg"
- objEmail.Textbody = "core msg"
- objEmail.Send
- End If
|
a voir si ca peut aider ou pas... perso je trouve ca interressant