strEmailTo= " [email protected] ",
strEmailFrom= " DNS övervakar ",
strDomain= " yourdomain.com ",
strDNSServer= " 4.2.2.2 ",
strSMTPServer= " yoursmtpserver ",
iSMTPPort=25
Gör
Fastställd objShell = CreateObject (”WScript.Shell”)
Fastställd objNSLookup = objShell.Exec (”nslookup - q=MX”&strDomain&” ”&strDNSServer)
Fastställd objStdOut = objNSLookup.StdOut
strOutput = objStdOut.ReadAll
bChanged=False
Om Instr (strOutput, strDomain&vbTab& " MX-preferens = 8, postar exchangeren = ”&strDomain&” .s5b2.pts.com”), därefter bChanged=True =0
Om Instr (strOutput, strDomain&vbTab& " MX-preferens = 2, postar exchangeren = ”&strDomain&” .s5a1.pts.com”), därefter bChanged=True =0
Om Instr (strOutput, strDomain&vbTab& " MX-preferens = 4, postar exchangeren = ”&strDomain&” .s5a2.pts.com”), därefter bChanged=True =0
Om Instr (strOutput, strDomain&vbTab& " MX-preferens = 6, postar exchangeren = ”&strDomain&” .s5b1.pts.com”), därefter bChanged=True =0
Om bChanged=True därefter
Fastställd objEmail = CreateObject (”CDO.Message”)
objEmail.From = strEmailFrom
objEmail.To = strEmailTo
objEmail.Subject = ”DNS ändrade”,
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
Avsluta om
wscript.sleep 60000
Kretsa
|