My question is: in Windows Server 2012, is it possible to launch an event when a device is connected to a USB port? I mean: any device, including a keyboard or a mouse, not just storage USB drives.
The idea behind this question is as follows: I want my Windows Server 2012 machine to shut down (ergo: encrypt the disk) immediately after a device is connected to the USB port. This is intended as an additional layer of protection from data theft. Shutting the server down is a trivial matter of executing shutdown /s /t 0
but I first need a trigger for that.
I have done some research (here, on Serverfault and IT Security, as well) and seen some interesting answers, including this one in particular. Close, but still no cigar, as the questions and answers found refer almost exclusively to storage devices and mine has a way wider scope.
It might be a PowerShell script running in the background or a trigger in Task Scheduler, just point me in the right direction - I'm pretty much new to the Windows ecosystem. Is it possible to achieve such a thing?