PowerShell for Windows Admins

Aug 31 2010   2:03PM GMT

WMI and Network Adapters: 3



Posted by: Richard Siddaway
Tags:
Network
PowerShell v2

 

We have seen how to query WMI for information on network adapters.  But what we didn’t get was information about the addresses allocated to the NICs.  We need a different class for that

Get-WmiObject -Class Win32_NetworkAdapterConfiguration

However this gives us too much information as it includes all cards – we only want to see those with addresses

Get-WmiObject -Class Win32_NetworkAdapterConfiguration | where {$_.IPAddress}

Gives us the two NICs (on my machine that are live). 

To just get the addresses

Get-WmiObject -Class Win32_NetworkAdapterConfiguration | where {$_.IPAddress} | Foreach { $_.Description; $_ | select -ExpandProperty IPAddress}

Gives a quick view of the addresses associated with each card

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: