I'm trying to set a specific NIC with a static IP Address. I was referencing this SO post (answered by Marc) which show's how to do so except it will set all NIC's which are Enabled. I'm trying to only set a specific one. This is what I thought you'd do it but it doesn't work and I'm wording if anyone can point out what I'm doing wrong?
foreach (var managementObject in networkConfigs.Cast<ManagementObject>().Where(managementObject => (bool)managementObject["Caption"].ToString().Contains("Local Area Connection 2")))
{
.. the rest of the code is the same...
}