danlance

PowerShell - List IP4 Addresses

Aug 31st, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Get-WMIObject win32_NetworkAdapterConfiguration |
  2.   Where-Object { $_.IPEnabled -eq $true } |
  3.   Foreach-Object { $_.IPAddress } |
  4.   Foreach-Object { [IPAddress]$_ } |
  5.   Where-Object { $_.AddressFamily -eq 'Internetwork'  } |
  6.   Foreach-Object { $_.IPAddressToString }
Advertisement
Add Comment
Please, Sign In to add comment