1

I am trying to find out what USB devices are plugged into a network computer, if possible returning a list like in device manager.

I am going to be checking all the computers on the network to query if a USB memory stick is inserted to locate that device, so it is may be possible to detect the drive letter it creates?

alternatively the device also creates a disk drive when it is plug in which could be located also.

i have tried to use the admin share C$ like below however this does not work

Directory.GetDirectories(@"\\192.168.0.112\C$) 

any suggestions on this topic would be helpful.

i.t.c
  • 11
  • 2
  • 1
    https://stackoverflow.com/questions/6003822/how-to-detect-a-usb-drive-has-been-plugged-in – William Xifaras Mar 27 '17 at 15:11
  • Find out how to do it locally first using WMI. I think there's some WMI stuff that, if you have correct permissions, you can iterate devices on a remote computer once you connect with WMI as well. – Brandon Mar 27 '17 at 15:11

1 Answers1

0

If you want to query a remote computer as to what devices are plugged in then you can access the Windows Management Instrumentation service on that machine. You will require administrator rights to do this though.

The WMI service provides meta data about the machine it's running on.

More info about accessing WMI can be found here: https://msdn.microsoft.com/en-us/library/aa389290(v=vs.85).aspx

It also accepts queries not too dissimilar to SQL.

Ross Miller
  • 656
  • 3
  • 9
  • Thanks, this looks like what i need, ill look in to this and see if i can work out a solution. – i.t.c Mar 28 '17 at 13:20