I want to get the DeviceID and Service of all PCSC smart card readers on my system using WMI. They're all connected via USB, so I query the WMI registry for all Win32_PnPEntity
s. But I have no clue how to determine which devices are 'card readers'. Here's what I already have:
ManagementObjectSearcher mos =
new ManagementObjectSearcher(@"\root\cimv2", @"Select * From Win32_PnPEntity");
ManagementObjectCollection mob = mos.Get();
foreach (ManagementObject mo in mob)
{
Console.WriteLine("DeviceID: " + mo["DeviceID"].ToString());
Console.WriteLine("Service: " + mo["Service"].ToString());
}
I can't just filter on the device name, there's different brands/models of readers, and there's no common denominator. In the Device Manager they're all grouped under 'smart card readers', so there must be a(nother) way.