Use WMI to detect a USB drive was connected, regardless of whether it was mounted?
Posted
by Seth Petry-Johnson
on Server Fault
See other posts from Server Fault
or by Seth Petry-Johnson
Published on 2010-02-22T18:36:51Z
Indexed on
2010/04/07
11:03 UTC
Read the original article
Hit count: 335
I am writing a script that uses MS KB 823732 to temporarily prevent users from plugging in new USB storage devices. This works fine, and the HKLM\...\Services\UsbStor
registry key successfully blocks newly-connected devices from being accessed.
Is there a WMI event that will tell me that a drive was connected, regardless of whether it was mounted?
I tried querying for __InstanceCreationEvent
but that is apparently raised only after the drive is mounted and made available, which doesn't fit my requirements.
© Server Fault or respective owner