Get Public IP Address

Quick Description This Automation Policy retrieves the public IP of a device.
Applies To On-premises N-able N-central 8.1.0.1086
Last Revised Feb. 21, 2012

Overview

This Automation Policy will query http://ifconfig.me/ip to retrieve the public IP of the device.

Input Parameters

No input parameters are required.

Automation Policy

Outcome

Public IP of device is retrieved.

Troubleshooting

Retrieve Public IP Powershell code:

$r = [System.Net.WebRequest]::Create("http://automation.whatismyip.com/n09230945.asp")

$resp = $r.GetResponse()

$reqstream = $resp.GetResponseStream()

$sr = new-object System.IO.StreamReader $reqstream

$result = $sr.ReadToEnd()

write-host $result