Get IP informations on a remote computer with PowerShell

Hello,

Here one of the many ways of retrieving IP configuration of NIC on a remote machine.
We’ll use “Win32_NetworkAdapterConfiguration” WMI class :

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled=$true" -ComputerName SQL

Note : The “-Filter” allow us to retrieve only NIC with IP configured.

Gwmi-IP

With the appropriate properties and several computers :

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled=$true" -ComputerName SQL,2K8R2,WSUS,SOFSR2Node1,SOFSR2Node2 | Select-Object __SERVER,Description,DHCPEnabled,DHCPServer,DNSDomainSuffixSearchOrder,DNSServerSearchOrder,IPAddress,DefaultIPGateway,IPSubnet,MACAddress,FullDNSRegistrationEnabled | Format-Table

Gwmi-IP-Selected

There’s a lot of columns, so you can replace the “Format-Table” with “Out-GridView” go get a nicer output :

Gwmi-IP-OGV

 

Leave a Reply