Finding computers with two of the same hardware device?
Nathan Willis
Hi, I'm trying to run a report / make a collection that shows computers that contain two of the same hardware device - specially in this case, graphics cards.
Can anyone provide some guidance? In this case, I'd be looking at say, a Hardware Device Name containing "GTX" and isolating machines that have two listings for it in their devices. Thanks in advance if anyone's able to help me out with this.
1
Comments
Nathan,
Will a report work or do you need it to be a collection?
If a report will work you could just do a SQL report. You can query the "HardwareDevices" table to find your graphics cards by searching for fields containing GTX. You could them group by computer name and look for results with more than one.
Here's a starting point for the SQL report, you could probably get it to show only machines that have more than one by adding a field to count the results and grouping them properly. Sorry, I'm no SQL expert and I don't have the time to delve further into it right now:
select
Computers.Name as "Computer Name",
HardwareDevices.Name
from Computers, HardwareDevices
where <ComputerFilter> and HardwareDevices.Name like '%GTX%' and HardwareDevices.ComputerId == Computers.ComputerId
Thanks Luke, using your starting point here's what I ended up with (just in case some future person wants to do something similar):
Great work, glad I was able to at least point you in the right direction.