Get-IPConfig (Powershell)

This Script will output the IP Configuration of you computer.

It runs with default parameters of Local Computer and Show only the Connected Devices.

But you can change it to run on remote Computers and / or show all available Network Configuration.


Download The Script

 


# ==========================================================

# Get-IPConfig.ps1

# Made By : Assaf Miron

# http://assaf.miron.googlepages.com

# Description : Formats the IP Config information into powershell

# ==========================================================


function Get-IPConfig{

param ( $RemoteComputer="LocalHost",

$OnlyConnectedNetworkAdapters=$true

 )

 

gwmi -Class Win32_NetworkAdapterConfiguration -ComputerName $RemoteComputer | Where { $_.IPEnabled -eq $OnlyConnectedNetworkAdapters } | Format-List @{ Label="Computer Name"; Expression= { $_.__SERVER }}, IPEnabled, Description, MACAddress, IPAddress, IPSubnet, DefaultIPGateway, DHCPEnabled, DHCPServer, @{ Label="DHCP Lease Expires"; Expression= { [dateTime]$_.DHCPLeaseExpires }}, @{ Label="DHCP Lease Obtained"; Expression= { [dateTime]$_.DHCPLeaseObtained }}

Comments