Simple Windows DynDNS Updater

02 Dec 2016

How To Use Windows Task Scheduler To Update Your DynDNS Domain

  1. Create a little PowerShell Script as follows

    $Hostname = "YourDomain.myonlineportal.net"
    $User     = "YourMyOnlinePortalUsername"
    $Pass     = "YourMyOnlinePortalPassword"
    
    Invoke-RestMethod -Uri "myonlineportal.net/updateddns?hostname?$Hostname&username=$User&password=$Pass"
  2. Save this to your harddisk, for our example we will use "C:\Users\Administrator\ddnsupdate.ps1"
  3. Test your script on the cmd by executing powershell -file "C:\Users\Administrator\ddnsupdate.ps1"
  4. Open the "Task Scheduler"
  5. From menu "Action" -> "Create Task..."
  6. Name the task and also activate "Run whether user is logged on or not"
  7. Change to Triggers and create a new one and select Repeat task every: 5 Minutes for a duration of "Indefeinitely" -> "OK"
  8. On Tab Action create a new one, as Action choose "Start a program", Programm/Script set to "powershell" and as Argument add -file "C:\Users\Administrator\ddnsupdate.ps1"
  9. Thats all, just wait 5 minutes and on the Dynamic DNS Tab of the MyOnlinePortal Homepage you should see an update with appropriate timestamp
  10. Keep in mind, that if you test the script before, the IP was already setted and nothing changed. To test this on your real domain, just set your domain manually on the homepage to a fake ip, like 127.0.0.1 and wait 5 minutes.
Things to do / to be evaluated

Add a comment