2

I am working with POS systems where we do not want employees to plug in USB drives, keyboards, mice, or ANYTHING into the ports.

I have looked for many solutions to permanently disable the power to / operation of USB ports. Cannot find anything too effective.

I've noticed there are usually multiple "USB Root Hubs" / "Generic USB Hub" / "Intel Host Controllers" depending on each individual PC. Working in Win 7, but doubt that it matters.

Is there a way to effectively totally remove USB usability, including keyboard & mouse?

Preferably a VBScript, PowerShell Script, or batch command since it will be pushed across hundreds of PC's?

Edit: Uninstalling does exactly what I need. How would I create a powershell script to uninstall these drivers?

Currently starting with:

$hubs = Get-WmiObject Win32_USBHub

which returns:

\LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\ROOT_HUB30\7&AF4FDB&3&0" \LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\VID_2109&PID_0210\8&256E5DBF&0&3" \LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\ROOT_HUB30\4&1097135A&4&0" \LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\VID_0D62&PID_910E\5&1F94A3C&1&1" \LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\VID_1532&PID_0233\5&1F94A3C&1&8" \LAPTOP-CFDT09FN\root\cimv2:Win32_USBHub.DeviceID="USB\VID_2109&PID_2210\5&1F94A3C&1&11" PS C:\Users\Will.Davis>

Will
  • 45

3 Answers3

1

Disabling all "USB Root Hubs" should disable all USB ports. This will remove most of the other USB items from below "Universal Serial Bus controllers", there may be one or more remaining USB options that will also be needed to be disabled.

devcon is a useful utility for manipulating devices.

This can also be done using the following .reg script:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"Start"=dword:00000004 

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]
"Count"=dword:00000000
"NextInstance"=dword:00000000

You might also be interested in the PowerShell script at usbManager.ps1.

harrymc
  • 498,455
1

Get a hot glue gun, and put hot glue in the USB sockets.

K7AAY
  • 9,725
0

I can confirm, that if you have PowerShell 5.1 (which does not come natively in Win7, you would have to update), this command will Disable all USB Ports:

Get-PnpDevice -Class USB | Disable-PnpDevice

in my case it threw a lot of errors but worked. But only after I restarted the machine.

I forgot that i tested this 3 days ago for your question. This night Windows Update restarted my computer, and when I came to work in the morning i couldn't use my USB-Mouse and Keyboard anymore.

Get-PnpDevice -Class USB | Enable-PnpDevice

Will restore your USB Devices to normal again

SimonS
  • 9,869