1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
|
" codeBody "
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
|