strEmailTo= " [email protected] "
strEmailFrom= " DNS-Monitor "
strDomain= " yourdomain.com "
strDNSServer= " 4.2.2.2 "
strSMTPServer= " yoursmtpserver "
iSMTPPort=25
Tun
objShell = CreateObject („WScript.Shell“) einstellen
objNSLookup = objShell.Exec („nslookup - q=MX „&strDomain&“ „&strDNSServer) einstellen
objStdOut = objNSLookup.StdOut einstellen
strOutput = objStdOut.ReadAll
bChanged=False
Wenn Instr (strOutput, strDomain&vbTab& " MX-Präferenz = 8, Postaustauscher = „&strDomain&“ .s5b2.pts.com“) dann bChanged=True =0
Wenn Instr (strOutput, strDomain&vbTab& " MX-Präferenz = 2, Postaustauscher = „&strDomain&“ .s5a1.pts.com“) dann bChanged=True =0
Wenn Instr (strOutput, strDomain&vbTab& " MX-Präferenz = 4, Postaustauscher = „&strDomain&“ .s5a2.pts.com“) dann bChanged=True =0
Wenn Instr (strOutput, strDomain&vbTab& " MX-Präferenz = 6, Postaustauscher = „&strDomain&“ .s5b1.pts.com“) dann bChanged=True =0
Wenn bChanged=True dann
objEmail = CreateObject („CDO.Message“) einstellen
objEmail.From = strEmailFrom
objEmail.To = strEmailTo
objEmail.Subject = „DNS änderte“
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
Beenden wenn
wscript.sleep 60000
Schleife
|