I'm trying to block the Redmi (Xiaomi) Mobile Device when it plugs in to my windows laptop. I created a notification query using WMI to capture the Redmi (Xiaomi) device if plugs in using USB data cable. The query used is
SELECT * FROM __InstanceCreationEvent within 5 WHERE targetinstance isa 'Win32_PnpEntity'.
When we plug in for the first time using usb data cable (Defaultly it takes charging only option) then Instance event is getting captured but when i change the option from charging only to Transfer Files then it is not registering an event and iam able to transfer files. Because of this iam unable to capture and block the Redmi (Xiaomi) device.
How to capture the event as it is not getting detected for this Redmi (Xiaomi) mobile device alone but other devices like samsung, apple it is detecting as expected.