Home » PowerShell » #PowerShell Quickie: Get-Nicbinding.ps1

I’m working on a PowerShell script to perform a Health and Config check for Exchange Server 2010 installs.  One of those checks is to verify the NIC binding order, which took me down the path of this script.  I traditionally write new scripts that run multiple processes in a modular format, just so I know that my logic is solid, and then I integrate them together.

There are a few ways to extract the NIC info, but for my usage I needed to correlate data from the Registry and from WMI.  I essentially needed to see a list of binding order similar to what you see in the GUI, the name of the NIC, and it’s current state.  Many times we have NIC’s that aren’t used for one reason or another on physical boxes and those NIC’s are placed in a disabled state.  I like to make sure they are disabled.

Note: This script has had very limited testing, I have tested on a hand full of lab machines and physical boxes.  If you find results aren’t accurate, post up a comment and let me know and I will try to address.

The next evolution of this script is to enable the user to fix anything not up to standard. For now, I will be adding an option to open Ncpa.cpl and use the GUI(ugh) to address. ;)