Skip to content

Instantly share code, notes, and snippets.

@gitfvb
Last active April 7, 2016 10:44
Show Gist options
  • Save gitfvb/8515b64b285a2386b11f2a455ca45bcb to your computer and use it in GitHub Desktop.
Save gitfvb/8515b64b285a2386b11f2a455ca45bcb to your computer and use it in GitHub Desktop.
Update DynDNS via powershell (in this case strato). Replace the variables {host}, {username} and {password}. Also change your DynDNS-provider.
$ExtIPv4 = Get-NetIpAddress -InterfaceAlias "Ethernet 2" -AddressFamily "IPv4"
$source = "https://dyndns.strato.com/nic/update?hostname={host}&myip=$($ExtIPv4.IPAddress)"
$user = "{username}"
$pass = "{password}"
$secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($user, $secpasswd)
Invoke-WebRequest -Uri $source -Credential $credential
exit 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment