Announcement

Collapse
No announcement yet.

DHCP Lease Notification Script v2.4 released

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • DHCP Lease Notification Script v2.4 released

    Hi All

    You may remember my DHCP Lease Notification script (http://forums.petri.com/showthread.php?t=2828)

    So here it is....

    ....enjoy

    EDIT: Version 2.4 released. Now only supports Server 2008 DHCP. It still checks Active Directory for the computer account first before e-mailing. This way you will only be notified when new computers to your network get a DHCP lease.

    Head to http://tonyyeb.blogspot.com for the latest version download. If you appreciate my work, please hit a Google Ad or send me a beer by PayPal. Cheers.
    Last edited by tonyyeb; 24th August 2011, 15:03.
    Server 2000 MCP
    Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

  • #2
    Re: DHCP Lease Notification Script v2.0 released

    Thnx Tonyyeb!!
    Post has been made sticky.
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      DHCP Lease Notification Script v2.0 **modified**

      I have modified the DHCP checker script.

      I have changed the e-mail method to use a command line SMTP client (posite).

      It can easily be modified further to accomodate another command line SMTP client such as BLAT.

      Also the script now catches more that one event type each time it reads the log.

      I have also added an IF statement to check that the hostname does not match the domain specified (in a vairable in the script).

      Please refer questions about making further modifications to the original author as he retains overall copywright.

      Thanks
      Attached Files

      Comment


      • #4
        Re: DHCP Lease Notification Script v2.0 **modified**

        Just to make clear, razzman asked permission to make changes to the script before doing this, which I allowed so long as he uploaded it for other people to make use of.

        Thanks razzman
        Server 2000 MCP
        Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Re: DHCP Lease Notification Script v2.0 **modified**

          New version released. See opening post for more info. No longer supporting anything less than current version now.
          Server 2000 MCP
          Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

          ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

          Comment


          • #6
            Re: DHCP Lease Notification Script v2.2 released

            Hi,

            Is it still possible to send SMTP mail from the IIS (with cdonts.dll) ???, I doesn't receive any error when I run the script, but no mails

            Comment


            • #7
              Re: DHCP Lease Notification Script v2.2 released

              Originally posted by paruma View Post
              Hi,

              Is it still possible to send SMTP mail from the IIS (with cdonts.dll) ???, I doesn't receive any error when I run the script, but no mails
              Try pointing the email server IP address at your IIS server running an SMTP virtual host. I use this in conjunction with Exchange but it should be the same.
              Server 2000 MCP
              Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

              ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

              Comment


              • #8
                Re: DHCP Lease Notification Script v2.2 released

                Originally posted by tonyyeb View Post
                Try pointing the email server IP address at your IIS server running an SMTP virtual host. I use this in conjunction with Exchange but it should be the same.
                - This is already done... I can send SMTP mails from another script (on same server), and your old version of DHCP Notification was also working perfect, but I would like to have the new feature with the domain filtering...

                Code:
                'command string constructed that is used to run smtp e-mail client.  Note very last part is the path to a temporary file that comprises the body of the e-mail.
                strEmlExec = chr(34) & "WHAT SHOULD I WRITE HERE?, WHEN I USE IIS SMTP?" & chr(34) & " -host:" & strMailserver & " -to:" & strTo & " -from:" & strFrom & _
                  " -s:" & strSubject & " -file:" & "c:\dhcpNotifytemp.log"

                Comment


                • #9
                  I saw this excellent script on one of your forums, But, when running this script I'm getting an error message for these two lines:

                  ceventhost = arrdhcprecord(5)
                  ceventmac = arrdhcprecord(6)

                  After editing the domain, email, smtp server, I'm getting the following script error:


                  Subscript Out of Range: '[number 5]'
                  Subscript Out of Range: '[number 6]'

                  Thanks
                  Attached Files
                  Last edited by Wired; 30th January 2011, 02:54. Reason: merged posts

                  Comment


                  • #10
                    Re: DHCP Lease Notification Script v2.2 released

                    lions1855, please don't double post, posts merged.
                    ** Remember to give credit where credit is due and leave reputation points where appropriate **

                    Comment


                    • #11
                      Re: DHCP Lease Notification Script v2.2 released

                      Originally posted by lions1855 View Post
                      I saw this excellent script on one of your forums, But, when running this script I'm getting an error message for these two lines:

                      ceventhost = arrdhcprecord(5)
                      ceventmac = arrdhcprecord(6)

                      After editing the domain, email, smtp server, I'm getting the following script error:


                      Subscript Out of Range: '[number 5]'
                      Subscript Out of Range: '[number 6]'

                      Thanks
                      The dhcpchecker.vbs script need some adjustments to work also in Windows server 2008 domains.

                      mainly the line: if instr(strline, ",") then
                      should be replaced by: If UBound(split(strline, ",")) > 6 Then

                      And maybe some optimalisations here and there.


                      \Rems

                      This posting is provided "AS IS" with no warranties, and confers no rights.

                      __________________

                      ** Remember to give credit where credit's due **
                      and leave Reputation Points for meaningful posts

                      Comment


                      • #12
                        Re: DHCP Lease Notification Script v2.2 released

                        I have already made some modifications and posted on my blog http://tonyyeb.blogspot.com

                        I intend to update the DHCP checker script to include support for 2008 DHCP servers as suggested by Rems
                        Server 2000 MCP
                        Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                        Comment


                        • #13
                          Re: DHCP Lease Notification Script v2.2 released

                          The script process much better than the last one. However, it stopped in line 130 just around the loop command

                          Line 130 - loop
                          Line 131 - if foundentry = 1 then
                          Line 132 - objCDOMail.To = strEmailTo
                          Line 133 - objCDOMail.Subject = strEmailSubject
                          Line 134 - objCDOMail.TextBody = strBody
                          Line 135 - objCDOMail.Send
                          Line 136 - Set objCDOMail = Nothing
                          Line 137 - else
                          Line 138 - end if
                          Line 139 - objtextfile.close


                          the it stopped in line 138 looking for another End If. Then, after entering the code that it was looking for, it stopped in line 1395 looking for Loop.

                          And, it finally stopped again in line 70 under "strline = objtextfile.readline".

                          Any clueas

                          Comment


                          • #14
                            Re: DHCP Lease Notification Script v2.4 released

                            New version released with bug fixes. Now only supports Server 2008 DHCP. May work with 2003 but it has not been tested with it. Use at own risk.

                            Head to http://tonyyeb.blogspot.com for the latest version download. If you appreciate my work, please hit a Google Ad or send me a beer by PayPal. Cheers.
                            Server 2000 MCP
                            Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

                            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                            Comment


                            • #15
                              Re: DHCP Lease Notification Script v2.4 released

                              Still for the same reason that some student brought in an unauthorized system?
                              Marcel
                              Technical Consultant
                              Netherlands
                              http://www.phetios.com
                              http://blog.nessus.nl

                              MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
                              "No matter how secure, there is always the human factor."

                              "Enjoy life today, tomorrow may never come."
                              "If you're going through hell, keep going. ~Winston Churchill"

                              Comment

                              Working...
                              X