Last active
April 7, 2016 10:44
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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