> Automation > Policies > Diagnostics > Get Public IP Address

Get Public IP Address

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


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

Input Parameters

No input parameters required.

Automation Policy


Public IP of device is retrieved.


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