Get Static/Public IP Address using PowerShell.

HI,Sometime we need to know the static/Public IP address of our internet connections. You may need to incoprate a static ip adress of the user in to some script output. You may be you want to show static IP in some of your in-house WPF PowerShell based GUIs.In my scenerio i need

Static-Ip.ps1
 
 
 
 
 
4.6 Star
(11)
4,683 times
Add to favorites
Networking
6/12/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • This script works on windows 10
    1 Posts | Last post April 01, 2016
  • Many IPs
    1 Posts | Last post November 05, 2014
    • Hi Aman,
      
      There are many ips in one interface, and NAT 1:1.
      
      I´d like test public IP and choose Source local IP, I tried use this object below but I can´t.
      $IPEndPoint = New-Object System.Net.IPEndPoint($InterfaceIP, $InterfacePort)
      $Socket = new-object System.Net.Sockets.TcpClient($IPEndPoint)
  • Need help!!
    1 Posts | Last post November 19, 2012
    • Hi Aman,
      Could you please help me getting static IP address, Subnet Mask, Default Gateway and Pri DNS and Sec DNS from the list of host name.
      thanks
      Prashant
  • Thanks Rich Prescott
    2 Posts | Last post October 09, 2012
    • Thanks for one liner. It is very useful. And thanks to Aman for the concept.
    • Hi Parmaths,
      You are welcome .
      
      thanks
      aman
  • PowerShell v3 version
    2 Posts | Last post October 09, 2012
    • ((Invoke-WebRequest "http://checkip.dyndns.com").ParsedHtml.Body.innerHTML -split ': ')[1]
    • Thanks Rich :) 
      But that will work on Powershell V3, Isnt ?
      
      thanks
      aman