Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $web = Invoke-WebRequest -Method Get -Uri "https://ipv4.icanhazip.com/"
- $ip = $web.Content
- $hostname = "server01.llama.se"
- $user = "llama.se"
- $pass = "bllllllaaahg"
- $pair = "${user}:${pass}"
- $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
- $base64 = [System.Convert]::ToBase64String($bytes)
- $basicAuthValue = "Basic $base64"
- $headers = @{ Authorization = $basicAuthValue }
- Invoke-WebRequest -Method Post -Uri "https://dyndns.loopia.se?hostname=$hostname&MyIP=$ip" -Headers $headers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement