Subscribe
Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.
Recent Posts
- Avoid the Windows 10 Anniversary Update!
- Windows 10 free upgrade ends today
- Remote Control Enterprise 5.6 Released
- Remote Control 5.6 Released
- Prevent the Windows 10 Download
- Remove the Windows 10 upgrade nag message
- Automatically reboot idle computers
- Enterprise Remote Control Update
- Convert Hyper-V to VMWare
- Utility to clean out temp files
- Easy solution for “Cannot delete “file name”: The file name you specified is not valid or too long.”
- Windows flaw found – Make sure you patch today
- Burn files from the command line
- Enterprise Remote Control – Security Update
- Shutdown or reboot computers remotely
- The next version of Windows – Windows 10
- Shellshock – A vulnerability to look out for
- Power up computers remotely
- New tool from SysInternals – SysMon
- Enterprise Remote Control Security Update
- Free Backup Software for Hyper-V
- Free Networking and Windows Server Tutorials
- Turn virtual machines on and off from a script (Hyper-V)
- Remote Control 5.4 MSI Distribution
- Remote Control 5.4 Distribution Update
- Boot Windows 8 from an external drive
- Remote Control 5.4 Released
- Microsoft’s best kept secret – EMET
- Force Automatic Updates – Part 2
- Remote Control Beta 2 Released
- Clean up temp files remotely – Version 2
- Enterprise Remote Control – Security Patch
- Beta – Remote Control 5.4
- Important Security Mailing Lists
- See if a program “phones home”
- Security for virtual environments
- Windows XP Support Nag Window – FYI
- Tabbed folder view for Windows
- Free IT Training materials
- USB Disabler Pro Released with Free Edition
- Block Flash Drives, Phones, and Removable Media
- Free Windows Server 2012 R2 EBook
- Cleanup temp files remotely
- A simple IP Scanner for Windows
- Enterprise Remote Control Update
- Delete temp files from all user profiles
- Execute Defrag Remotely
- Cleanup Automatic Update Files Remotely
- Command prompt replacement for Windows
- Find your Windows 8 Product Key
- Show network activity in the system tray
- New build of Enterprise remote control released
- Network Administrator Update – IE Blocker Fix
- Prevent an Internet Explorer 11 automatic install
- Free tool to remotely manage Hyper-V
- Burn a DVD or CD from the command line
- Free backup utility for virtual machines
- Remove offline printers using vbscript
- Enterprise Remote Control Released
- Activity report for Windows – See what a user has been doing
- Sprinkler system controlled by a Raspberry Pi
- Disable cloud features in Office 2013
- Enterprise Remote Control – Final Beta
- Secure the Google Chrome Web browser using Group Policy
- Enterprise Remote Control – Users Guide (Rough Draft)
- A free tab based remote desktop tool
- Enterprise Remote Control Beta Released
- Remote support without the monthly fees
- Get the dell service tag remotely
- A simple utility to help users print system information
- A Windows 2012 RDP Shadowing Alternative
- The NSA Guide to finding private information on the Internet
- Get a Network Information Tool for Windows
- Block IE 10 – Keep it out of automatic updates
- Remote Control Online Beta 4
- The Internet in 1995
- Software to help you free up hard drive space
- How to refresh group policy remotely
- Remove unwanted programs easily
- New version of SystemInfo.exe Released
- Import a .reg file remotely
- How your users can easily report their system information to you
- How to list all USB devices on your network
- Remote Control Online Beta 3
- Force windows updates remotely – even when WSUS can’t
- Enable File and Printer sharing from a script
- Add a domain group as a local administrator from a script
- Find files quickly in Windows
- File and Drive Defrag Tool – UltraDefrag
- Peek around your network with a free utility
- Free Virtualization Software
- 10 Free E-Books from Microsoft Press
- Remote Control Online Beta 1.1
- Free E-Book – Windows 8: An overview for IT Professionals
- Remote Support over the Internet
- Windows 8 – Enable the Admin Share
- Set wireless settings from a script
- Manage automatic updates from the command line
- Easily disable file encryption
- Spy on computers remotely
Search
Archives
- August 2016 (1)
- July 2016 (1)
- May 2016 (2)
- February 2016 (1)
- July 2015 (1)
- March 2015 (3)
- February 2015 (2)
- November 2014 (2)
- October 2014 (3)
- September 2014 (3)
- August 2014 (3)
- July 2014 (3)
- June 2014 (1)
- May 2014 (3)
- April 2014 (4)
- March 2014 (4)
- February 2014 (4)
- January 2014 (4)
- December 2013 (3)
- November 2013 (3)
- October 2013 (4)
- September 2013 (4)
- August 2013 (1)
- July 2013 (5)
- June 2013 (3)
- May 2013 (5)
- April 2013 (4)
- March 2013 (5)
- February 2013 (3)
- January 2013 (3)
- December 2012 (2)
- November 2012 (4)
- October 2012 (4)
- September 2012 (4)
- August 2012 (5)
- July 2012 (3)
- June 2012 (5)
- May 2012 (4)
- April 2012 (4)
- March 2012 (4)
- February 2012 (5)
- January 2012 (4)
- December 2011 (4)
- November 2011 (5)
- October 2011 (4)
- September 2011 (5)
- August 2011 (5)
- July 2011 (4)
- June 2011 (4)
- May 2011 (4)
- April 2011 (4)
- March 2011 (5)
- February 2011 (2)
- January 2011 (4)
- December 2010 (4)
- November 2010 (3)
- October 2010 (5)
- September 2010 (3)
- August 2010 (5)
- July 2010 (5)
- June 2010 (5)
- May 2010 (5)
- April 2010 (2)
- January 2010 (1)
- September 2009 (4)
- August 2009 (4)
- July 2009 (5)
- June 2009 (9)
- May 2009 (8)
- April 2009 (3)
- March 2009 (1)
- February 2009 (2)
- January 2009 (7)
- December 2008 (11)
- November 2008 (21)
- October 2008 (10)
- September 2008 (1)
- August 2008 (2)
- July 2008 (12)
- June 2008 (3)
- May 2008 (3)
- April 2008 (4)
- March 2008 (3)
- February 2008 (8)
- January 2008 (7)
- December 2007 (7)
- November 2007 (17)
- October 2007 (23)
- September 2007 (19)
- August 2007 (25)
- July 2007 (2)
- June 2007 (11)
- May 2007 (1)
- April 2007 (6)
- March 2007 (6)
- February 2007 (6)
- January 2007 (10)
- December 2006 (23)
- November 2006 (35)
- October 2006 (8)
- September 2006 (6)
- July 2006 (4)
- June 2006 (8)
- May 2006 (7)
- April 2006 (14)
- January 2006 (20)
- May 2005 (1)
Get notified when an IP changes
[η»ε:Post image for Get notified when an IP changes]by Steve Wiseman on December 16, 2011 · 9 comments
I got a question from John this week:
“A few of my clients are using a broadband connection with DHCP addresses for the public interface. Do you know of a script or program that can be used to monitor the IP address and send a email if the IP address changes?”
Good question. It is possible to get IP address lists from VB Script, but we happen to have a utility we have used internally for quite some time. It is called “MyIP.exe”
MyIP.exe has two options. You can get a current list of IP addresses like this:
MyIP.exe /list
It will return a list of your current IP addresses to the command line:
C:\temp>myip /list
10.10.29.231
192.168.68.1
192.168.198.1
The second option is /wait. It will pause until it sees an IP change. When the change happens it will pause for 15 seconds to allow any DHCP addressing to settle down, and then finally return the result to the command line.
How do we set this up to email when we detect an IP change?
We can use blat. Blat is a tool for sending email from the command line.
Here is how I would structure a bat file to use both programs:
:Loop
@ECHO OFF
ECHO IP Address Change> status.log
ECHO =========================>> status.log
ECHO The computer %COMPUTERNAME% has had an IP address change>> status.log
ECHO This is the new IP list:>> status.log
MyIP.exe /wait>> status.log
blat.exe -f support@intelliadmin.com -to support@intelliadmin.com -server mysmtp.server.com -subject "IP Change" -bodyF status.log
ECHO "Waiting for IP Change..."
goto loop
What is going on in the code above?
First we build up a file called status.log. It is filled with the body of our email. It contains everything except our list of changed IP addresses. Then MyIP.exe will wait until a change happens – when it does, those IPs are written to the end of status.log
Finally, blat sends out the text file with the subject “IP Change”. When that is done, it loops back around to wait for a change all over again.
One important thing to note about SMTP – Many internet providers are blocking send from port 25 by default, except to their own email servers. So make sure you test the script out before depending on it.
MyIP.exe can be found in our downloads section:
http://www.intelliadmin.com/index.php/downloads/
Blat can be found here:
One final note. Most likely you want this IP address information because you need to remote into their computer from time to time. Our Enterprise Remote control has this functionality built in. It will automatically track all IP address changes on remote machines, and you only need a username to find their computer! – Might save you a lot of time and trouble:)
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools
{ 9 comments… read them below or add one }
Great tip steve! Thanks, and keep it up.
Any idea if blat can be made to support ssl smtp connections? That would make it a heck of a lot more useful π
Good question Jennifer. I don’t think it can support SSL connections. One of the ways we get around the port 25 restriction (I think that is why you would like the SSL) is to setup our own external SMTP server on another port. Then we configure it to only allow one destination, or alert email address.
Hope that helps,
Steve
Hello steve, could you please help me to find way to monitor specific user account and know which PC he is logon in domain environment.
Hello Mahmoud,
This is actually not an easy thing. Active Directory does not keep this information stored across the domain. You would need a piece of software that would monitor all the systems in your domain, and keep track of where users are at…so I don’t think this can be solved with a simple script.
Hello Steve.
i couldn’t find MYip.exe in the link you mentioned to download so i searched on net and downloaded it as i did for blat.but there is no two menu for Myip,it runs and give u just your ip and how can i use blat to send email ? i used you batch file but it didn’t work,where should i type my credential to use smtp server because i wanna use my gmail account and smpt.gmai.com for that.
and another thing i downloaded Enterprise Remote control to test but how should i configure it to send email when an ip changes ? it’s very important to me to know when an ip changes on a server or clients that i’m their administrator.
thanks in advance.
You don’t need 3rd party software for this, batch files and vbs will do exactly same job.
Hi Dean,
You are right…but it can get quite complex. Using this free tool makes it easier.
We would love it if you could post your VBS and BAT files. Then users would not need to add an additional exe to the mix.
Thanks,
Steve
Hi,
I have seen the IP.exe and is a very good tool. But is it possible to send this information (public IP) to the registry.
I need this so desktop management tools can get this information into the reporting server.
Thanks,
Jobin