SQL Query To Find Machines With USB Disk Drives

 

This SQL query will return all of the machines that have USB Disk Drives along with the last logged on user name.

 

SQL Query:

 

Select  

CS.Name0,

CS.UserName0,

HD.DeviceID0,

HD.InterfaceType0

From v_Gs_Computer_System CS

Join v_Gs_Disk HD on CS.ResourceID = HD.ResourceID

Where HD.InterfaceType0 = 'USB'

Order By HD.DeviceID0

 

If you have no need for the last logged on user name you can use this slightly simplified version:

 

Select

SystemName0,

DeviceID0,

InterfaceType0

From v_Gs_Disk HD

Where InterfaceType0 = 'USB'

Order By DeviceID0

 

Published Sunday, January 28, 2007 1:23 PM by dhite
Filed under:

Comments

No Comments