strEmailTo= " [email protected] "
strEmailFrom= " DNS monitor "
strDomain= " yourdomain.com "
strDNSServer= " 4.2.2.2 "
strSMTPServer= " yoursmtpserver "
iSMTPPort=25
Plaats objShell = CreateObject („WScript.Shell“)
Plaats objNSLookup = objShell.Exec („nslookup - q=MX „&strDomain&“ „&strDNSServer)
Plaats objStdOut = objNSLookup.StdOut
strOutput = objStdOut.ReadAll
bChanged=False
Als Instr (strOutput, strDomain&vbTab& " MX voorkeur = 8, postruilmiddel = „&strDomain&“ .s5b2.pts.com“) =0 toen bChanged=True
Als Instr (strOutput, strDomain&vbTab& " MX voorkeur = 2, postruilmiddel = „&strDomain&“ .s5a1.pts.com“) =0 toen bChanged=True
Als Instr (strOutput, strDomain&vbTab& " MX voorkeur = 4, postruilmiddel = „&strDomain&“ .s5a2.pts.com“) =0 toen bChanged=True
Als Instr (strOutput, strDomain&vbTab& " MX voorkeur = 6, postruilmiddel = „&strDomain&“ .s5b1.pts.com“) =0 toen bChanged=True
Als bChanged=True toen
Reeks objEmail = CreateObject („CDO.Message“)
objEmail.From = strEmailFrom
objEmail.To = strEmailTo
objEmail.Subject = „veranderd DNS“
objEmail.Textbody = strOutput
objEmail.Configuration.Fields.Item _
(„http://schemas.microsoft.com/cdo/configuration/sendusing“) = 2
objEmail.Configuration.Fields.Item _
(„http://schemas.microsoft.com/cdo/configuration/smtpserver“) = strSMTPServer
objEmail.Configuration.Fields.Item _
(„http://schemas.microsoft.com/cdo/configuration/smtpserverport“) = iSMTPPort
objEmail.Configuration.Fields.Update
objEmail.Send
wscript.quit
Eind als
wscript.sleep 60000
Lijn
|