Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
They can just grab the ram and extract the headers and decrypt your drives? Sure, not that sneaky, but it may work. Maybe you could try applying some "hardware mod" as in make the case closed down tight. Make it impossible for anyone to access the machine unless they power it down. – Shiki Dec 9 '13 at 15:20
Why not disable the USB ports in the server's BIOS? – Ƭᴇcʜιᴇ007 Dec 9 '13 at 16:15
It's a great denial of service attack against yourself! What happens when the machine is powered on? – pjc50 Dec 9 '13 at 16:20
I meant that you've provided an extra way to shut the machine down by anyone who can get close to it. A better way of achieving this sort of physical security would be to put it in a locked cabinet. There's also no guarantee that you can do an orderly shutdown before whatever attack is on the stick is carried out. – pjc50 Dec 10 '13 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.