strEmailTo= " [email protected] "
strEmailFrom= " monitor del DNS "
strDomain= " yourdomain.com "
strDNSServer= " 4.2.2.2 "
strSMTPServer= " yoursmtpserver "
iSMTPPort=25
Hacen
Fijar el objShell = CreateObject (“WScript.Shell”)
Fijar el objNSLookup = objShell.Exec (“nslookup - &strDomain&” “el &strDNSServer del q=MX “)
Fijar el objStdOut = objNSLookup.StdOut
strOutput = objStdOut.ReadAll
bChanged=False
Si bChanged=True =0 de Instr (strOutput, strDomain&vbTab& " preferencia del MX = 8, cambiador de correo = “&strDomain&” .s5b2.pts.com”) entonces
Si bChanged=True =0 de Instr (strOutput, strDomain&vbTab& " preferencia del MX = 2, cambiador de correo = “&strDomain&” .s5a1.pts.com”) entonces
Si bChanged=True =0 de Instr (strOutput, strDomain&vbTab& " preferencia del MX = 4, cambiador de correo = “&strDomain&” .s5a2.pts.com”) entonces
Si bChanged=True =0 de Instr (strOutput, strDomain&vbTab& " preferencia del MX = 6, cambiador de correo = “&strDomain&” .s5b1.pts.com”) entonces
Si bChanged=True entonces
Fijar el objEmail = CreateObject (“CDO.Message”)
objEmail.From = strEmailFrom
objEmail.To = strEmailTo
objEmail.Subject = “DNS cambió”
objEmail.Textbody = strOutput
_ de objEmail.Configuration.Fields.Item
(“http://schemas.microsoft.com/cdo/configuration/sendusing ") = 2
_ de objEmail.Configuration.Fields.Item
(“http://schemas.microsoft.com/cdo/configuration/smtpserver ") = strSMTPServer
_ de objEmail.Configuration.Fields.Item
(“http://schemas.microsoft.com/cdo/configuration/smtpserverport ") = iSMTPPort
objEmail.Configuration.Fields.Update
objEmail.Send
wscript.quit
Terminar si
wscript.sleep 60000
Lazo
|