Detect changing Public IP with PowerShell

I’m using an internet connection from an ISP called Telfort, and this week my public IP-address suddenly changed (without notice) which left meĀ unable to receive email for 6 hours. Sadly, it’s not possible to get a static ip-address with this ISP.

To prevent future downtime I searched for a program that sends an email when my public IP-adress changes. I found an PowerShell script that fulfills all my needs.

This script checks the response every hour from the website ( the response is my external IP-address, generated with simple PHP code ). It checks whether the external IP is still the same as the one in the file ip.txt.

When it’s changed, an email is send to the user(s) that are defined in the .ps1 file. Of course, this is another email address then the one I host at my mail server at home.