Hi all,
I found this on another website:
Basically it checks your external IP from the webpage on your router and tells you if it has changed.
I would like to be able to run it as a scheduled task and have it email me if it's changed.
Some details that might be needed to customise it:
My router is a BT HH3 and the status page is:
http://192.168.0.1/html/settings/a_internet.html
The IP text on the status page is written as:
Broadband network IP address: ??.???.??.???
My Email server is 192.168.0.3
Does anyone have any pointes on this one please?
Thanks,
G
I found this on another website:
Code :
# Create a web client object with the required credentials to access the router:
# -----------------------------------------------------------------------------
$WebClient = new-object System.Net.WebClient
$WebClient.Credentials = new-object System.Net.NetworkCredential accountname,password
# change "accountname,password" in the above line to that required for your router,
# or uncomment the following if you want to enter the username/password at run time
# instead of hard-coding it into the script:
# $WebClient.Credentials = Get-Credential
# Get the status page from the router and extract the IP address from it:
# ----------------------------------------------------------------------
$StatusPage = $WebClient.DownloadString( "http://192.168.1.1/Status_Router.asp" )
$StatusPage -match 'var wan_ip ".+"' | out-null
$IPAddress = $matches[0].Split('"')[1]
# The last two lines above may need to be customized to the particular layout
# of your router's status page
# Complain if the IP address is different:
# ---------------------------------------
if ( $IPAddress -ne "10.10.10.10" )
{
write-host -foregroundcolor red "`nIP Address has changed - it is now: $IPAddress`n"
exit 1
}
else
{
write-host -foregroundcolor cyan "`nIP Address is still $IPAddress`n"
}
Basically it checks your external IP from the webpage on your router and tells you if it has changed.
I would like to be able to run it as a scheduled task and have it email me if it's changed.
Some details that might be needed to customise it:
My router is a BT HH3 and the status page is:
http://192.168.0.1/html/settings/a_internet.html
The IP text on the status page is written as:
Broadband network IP address: ??.???.??.???
My Email server is 192.168.0.3
Does anyone have any pointes on this one please?
Thanks,
G