How to Block Unknown USB Devices in Windows 11: Step-by-Step Guide 2026
A practical Windows 11 guide for people who own or manage a PC and want control over which USB devices may connect.
To block unknown USB devices in Windows 11, open Group Policy, go to Removable Storage Access and set All Removable Storage classes to Deny all access. Windows 11 Home has no Group Policy editor, so use the matching registry value or software. Restart, then test with a spare drive.
| Works on | Windows 11 Pro, Enterprise, Education and Home |
|---|---|
| Time needed | 5 to 15 minutes for one PC |
| You need | An administrator account and a spare test drive |
| Cost | Free with built-in tools, or software for lists and logs |
| Undo | Reverse one setting, then restart |
Start with your situation
Pick the question closest to yours and the page jumps to the right place. Each choice leads either to a section of this guide or to a focused page that answers one narrower question, so you spend time only on what applies to you.
Quick answer and what you need first
Blocking unknown USB storage in Windows 11 takes one policy setting, a restart and a test drive. The part people skip is the preparation: knowing the edition, having an administrator account and writing the undo steps before changing anything.
Use these steps on a PC you own or administer. Blocking devices on someone else's machine, or on a work PC without permission, can break policy and laws. If you forgot your own admin password, recover it through the Microsoft account route first.
If the PC is a single home laptop you only use yourself, the restore point and the written note are still worth five minutes, but you can skip the multi-PC rollout section and go straight to the steps.
Why block unknown USB devices at all
An unknown USB device can copy data out, carry malware in, or pretend to be a keyboard. Blocking storage handles the first two. Each risk is different, which is why one setting rarely covers everything.
Data leaving
A drive plugged in for a minute can copy files faster than anyone notices. Insider risk is usually careless, not criminal.
Malware arriving
Autorun malware spreads from infected drives, and a shared PC with open ports is where it lands first.
Fake input devices
Some devices register as keyboards and type commands. Storage rules do not see them as storage.
Where USB blocking matters most
Shared family PCs, school and library machines, reception desks, kiosks, small office PCs holding client files and any laptop that travels. A single locked-down port policy is far cheaper than recovering from a leaked folder.
Blocking USB ports turns off every port on the PC.
Most USB blocking targets one device class, such as storage. A keyboard, mouse and charger keep working because they belong to other classes.
USB device classes: what each rule actually touches
Windows sorts USB devices into classes, and each policy touches only some of them. Knowing the class first prevents the classic accident of blocking something you needed, such as a keyboard or a printer, then compare it with the cheat sheet below.
| Device | Windows class | Removable storage deny | USBSTOR off | Installation rules |
|---|---|---|---|---|
| USB flash drive | Disk drives | Blocked | Blocked | Can be allowed by ID |
| External hard disk | Disk drives | Blocked | Blocked | Can be allowed by ID |
| Keyboard or mouse | Human Interface Devices | Not affected | Not affected | Blocked only if class is denied |
| Printer | Printers | Not affected | Not affected | Class rule needed |
| Phone, camera (MTP or PTP) | Windows Portable Devices | Needs the WPD setting | Not affected | Class rule available |
| Charging only | None | Not affected | Not affected | Power is not controlled |
| Takeaway | Storage rules are narrow | Safe for keyboards | Safe for keyboards | Broadest and riskiest |
Built-in Windows methods compared
Group Policy, the registry, Device Manager and Device Installation Restrictions all block USB, but at different levels of precision. Pick by edition, how many PCs you manage and whether you need an approved list or a log of attempts.
| Method | Editions | Precision | Approved list | Log | Effort | |
|---|---|---|---|---|---|---|
| Group Policy: Removable Storage Access | Pro, Enterprise, Education | Storage and portable device classes | No | No | Low | |
| Registry Deny_All value | All editions | Same policy as above, set by hand | No | No | Low | |
| USBSTOR service Start = 4 | All editions | Disables the storage driver | No | No | Low, but crude | |
| Device Manager: disable a device | All editions | One device at a time | No | No | High | |
| Device Installation Restrictions | Pro, Enterprise, Education | By class or hardware ID | Yes, by ID | Event log only | High | |
| USB blocking software | Per product | Storage control with password | Yes | Usually | Low | |
| Our reading | Policy first | Registry on Home | Last resort | Not for blocking | Use for lists and logs | Software for lists |
Disabling a device in Device Manager only works for a device that is already connected, and it does not stop the next drive. It is a repair step, not a policy.
Step by step: Group Policy and registry
Group Policy is the cleanest built-in route on Pro, Enterprise and Education. Home users set the same policy through the registry. Both steps end the same way: a restart and a test with a drive Windows has never seen.
Group Policy method
Group Policy writes the deny rule for you, which is safer than hand-editing the registry. It needs the Pro, Enterprise or Education edition and an administrator account. Home users follow the registry route further down this section.
Open the Group Policy editor
Press Win + R, type
gpedit.mscand press Enter.Go to Removable Storage Access
Open Computer Configuration, Administrative Templates, System, then Removable Storage Access.
Enable the deny rule
Open All Removable Storage classes: Deny all access, choose Enabled and press OK.
Apply and restart
Run
gpupdate /forcein an administrator terminal, then restart the PC.Test with a spare drive
Plug in a drive that was never connected. It should not open.
Registry method for Windows 11 Home
Windows 11 Home has no Group Policy editor, but the policy is just a registry value. Setting Deny_All to 1 under the RemovableStorageDevices policy key reproduces the deny-all rule on any edition, so Home users lose nothing except the menu.
A wrong registry edit can break Windows. Create a restore point first, and change only the values shown. The USBSTOR option also stops drives you may approve later, so use it only when you do not need an allow list.
Device installation rules for an unknown-device block
Device Installation Restrictions are the closest Windows gets to an unknown-device block. They prevent installation of anything not described by an allow rule. Used wrongly, they can also block your own keyboard, so build them slowly and test each step.
The policies live under Computer Configuration, Administrative Templates, System, Device Installation, Device Installation Restrictions. The useful ones are the setting that prevents installation of devices not described by other policies, and the allow settings for specific device IDs or setup classes.
Collect the IDs
In Device Manager, open each device you want to keep, then Details, Hardware Ids. Copy the strings.
Allow the classes you rely on
Allow Human Interface Devices before anything else so a keyboard and mouse survive.
Add allowed IDs
Enable allow installation of devices that match any of these device IDs and paste your approved list.
Prevent the rest
Enable the prevent installation setting and tick the layered order option so allow rules win.
Apply to installed devices
Tick the matching option if the rule must also reach devices already installed, and test a second keyboard first.
Before you apply a catch-all prevent rule, connect a spare keyboard through a separate port and confirm the allow rule covers it. A wrong rule on a PC with no remote access can mean a repair from recovery mode.
Software-based USB blocking, step by step
Blocking software gives one place to set a password, keep an approved list and read a log. It suits a single PC or a small office where hand-built device ID rules would take longer than the job deserves.
Download the installer
Get USB Block from the official download, or read the product page first.
Install and set a password
Run the installer as administrator, then set the control password. Without it, any user can switch the protection off.
Choose what to block
Turn on protection for USB storage devices and, if needed, other classes such as CD and DVD drives.
Add approved drives
Connect each approved drive once and add it to the list.
Check the log and test
Plug in an unlisted drive, confirm it is refused and read the entry in the log.

USB Block's product page does not list Windows 11 by name. Test it on one PC with a spare drive before relying on it, and keep your Group Policy or registry fallback written down.
- Strengths
- One password-protected control point
- Approved-drive list without hand-built IDs
- Access log for attempts
- Limits
- Third-party software to maintain
- Not an official Windows 11 listing
- Does not stop keyboard-style devices
How to allow approved drives only
An approved-drive list means everything is blocked except what you name. Windows can do this by hardware ID, and software can do it with a list. Both depend on IDs that are unique, which cheap drives sometimes are not.
| Approach | How it identifies a drive | Weak point |
|---|---|---|
| Device ID allow rule | Hardware ID from Device Manager | Many cheap drives share an ID |
| Instance ID allow rule | Serial based path | Breaks if the port path changes |
| Software list | Product's own device record | Depends on the product's method |
Whichever route you choose, keep the approved list short and written down. Review it whenever someone leaves, and remove drives that are lost.
How to verify the block worked
A block that is not tested is only a belief. Verification takes five minutes: a spare drive, a look at the policy value and a look at the event log. If any of the three disagree, treat the block as not working.
Use a brand new drive
A drive that was mounted before can keep its driver. A new one shows what the rule really does.
Read the policy value
In Registry Editor open the RemovableStorageDevices policy key and confirm Deny_All is 1.
Run gpresult
In an administrator terminal run
gpresult /rand check that the policy applies to the computer.Check Device Manager
Look under Disk drives and Universal Serial Bus controllers to see whether the device enumerated.
Read the event log
The DriverFrameworks-UserMode Operational log can show device activity such as events 2003, 2100 and 2102, once that log is enabled.

Common mistakes and how to avoid them
Most failed blocks come from five repeat mistakes. They are all avoidable, and most are about order of operations: testing before the restart, using the wrong scope or blocking more than you meant. Each one below comes with a plain fix you can apply today.
Use a storage rule, not a catch-all, unless you have allowed the keyboard class. Keep a second input device handy.
Windows keeps the driver for known devices. Use a drive that has never been connected.
Computer Configuration covers every user. User Configuration only covers the signed-in account.
Many changes only apply after a restart or after the device is reconnected.
Write down the exact value you changed, so anyone can reverse it later.
If it is blocked in Device Manager, it is blocked everywhere.
Disabling one device affects that instance only. A policy or software rule is needed for the next one.
Troubleshooting table
When a block does not behave, the cause is nearly always one of a small set. Match the symptom in the first column and try the fix. Detailed cases are in the separate guide on blocks that fail to hold.
| Problem | Likely cause | Fix |
|---|---|---|
| Drive still opens | Drive was already installed or policy not applied | Run gpupdate, restart, test with a new drive |
| Keyboard stopped working | Class rule too broad | Boot to recovery, undo the rule, allow the HID class |
| Policy greyed out or missing | Windows Home | Use the registry method |
| Phone still transfers files | WPD class not denied | Enable the WPD deny setting |
| Rule reverted | Domain or Intune policy overwrote it | Change the rule at the managing policy |
| Drive appears, access denied | Rule is working | Nothing to fix |
For a deeper walk through, see why a USB drive still works after you block it.
Office rollout checklist for several PCs
A rollout is a pilot first. Block one test PC, record what happens, then widen. Central policy through a domain or Intune reaches every PC the same way and lets you roll back from one place.
For help choosing between local rules and central ones, read Group Policy, registry or software compared.
How to re-enable USB ports safely as the administrator
Undoing a block means reversing the exact setting you changed, then restarting. Use the same method in reverse, and confirm with a known drive that the PC reads it again. Only do this on a PC you administer.
Open gpedit.msc, return to Removable Storage Access, set All Removable Storage classes: Deny all access to Not configured, then restart.
Set Deny_All back to 0, and set the USBSTOR Start value back to 3 if you changed it. Restart, then reconnect the drive.
Open the product, enter the control password and switch the protection off. If you forgot it, use the vendor support route listed on its site rather than guessing.
Cannot reach settings?
Can you sign in as an administrator?
Use the matching undo steps above, then restart.
Recover your own account first, using your Microsoft account recovery. Then reverse the rule. Do not attempt this on a PC you do not own.
Is this enough? What else to do after blocking
Blocking storage closes one door. A fuller plan adds device allow lists, drive encryption, up-to-date security software and a habit of reviewing what connects. The scorecard shows where your PC is still exposed, so you know what to tackle next.
Keyboard-style devices are a separate risk from storage, covered in the storage block versus keyboard attack guide. If you run Windows 11 Home and want an alternative to Group Policy, read USB control on Windows 11 Home.
Our top pick: USB Block for approved lists and logs
When you need a password, an approved-drive list and a log on one PC, USB Block is the tool we build for that job. It is our own product, and for a pure deny-all block the free built-in method is enough.
USB Block by NewSoftwares.net
We recommend USB Block when hand-built device ID rules would take longer than the job deserves. It blocks USB storage with a password, lets you approve specific drives and records activity.


Frequently asked questions
These are the questions people ask most when they block unknown USB devices in Windows 11. Use the filter to narrow the list, and open any question for a short direct answer without reading the whole guide.
On Pro, Enterprise or Education, open gpedit.msc, go to Computer Configuration, Administrative Templates, System, Removable Storage Access and enable All Removable Storage classes: Deny all access. On Home, set the Deny_All registry value or use blocking software. Then restart and test with a spare drive.
Yes. Group Policy, the registry and Device Installation Restrictions are built into Windows and cost nothing. They are blunt tools, though. If you want a password, an approved-drive list or an activity log on one PC, dedicated software is usually less work than hand-built rules.
On a Pro PC, the Group Policy deny-all setting takes about two minutes. On Home, one PowerShell line that sets the Deny_All registry value does the same job. Either way, restart and test, because a rule you never tested is a rule you cannot trust.
The common ones are blocking every device class so the keyboard stops working, skipping a restore point, editing the wrong policy scope, testing with a drive that was already mounted, and forgetting to write down how to undo the change. The mistakes section below covers each with a fix.
Plug in a spare drive that was never connected before. File Explorer should show no drive letter or an access-denied message. Then confirm the policy in Registry Editor or with gpresult, and look at Device Manager to see whether the device enumerated at all.
Yes. Storage rules such as Removable Storage Access and the USBSTOR service apply to storage classes, so a keyboard and mouse keep working. Blocking every new device by installation class is different and can lock you out, so allow the keyboard and mouse class first.
No. Storage and device policies control data access and driver installation, not power on the port. A phone can still draw charge. If you need a charge-only port, that is a hardware choice such as a data-blocking adapter, not a Windows setting.
Registry values work on Home, but the Group Policy editor is not included. Setting the policy values by hand reaches the same result for removable storage. Home also lacks some enterprise device controls, so a software tool is the cleaner choice when you need a list of approved drives.
Reverse whatever you changed: set the Group Policy to Not configured, set Deny_All back to 0, or set the USBSTOR Start value back to 3. Restart, then reconnect the drive. If you used software, open it with its password and switch the protection off.
Yes, but not with the simple deny-all setting. Device Installation Restrictions can allow a specific hardware ID and block the rest, and some USB blocking software keeps an approved list. Clone-prone IDs on cheap drives are the main weakness of ID-based lists.
Not as a single switch. Windows can prevent installation of devices not described by other policies, then allow listed IDs or classes. That is the closest built-in equivalent to an unknown-device block, and it needs careful testing because it can affect every USB device type.
No. A device that pretends to be a keyboard is not storage, so storage rules do not stop it. Storage blocking addresses data copying and malware drives. Keyboard-style attacks need a device allow list by class or ID, plus physical port control.
Phones and cameras that use MTP or PTP appear as Windows Portable Devices, which have their own deny settings under Removable Storage Access. Those settings are separate from the removable disk ones, so you can deny one group and leave the other alone.
Group Policy and registry policy values normally persist through updates. Still, check after major feature updates, because a managed PC can have its policy overwritten by a domain or Intune rule. Keep a one-line test in your admin notes and rerun it after each big update.
Related guides in this site
Four focused pages go deeper on single questions that this guide answers briefly. Each one covers one problem only, so you can read the one you need without wading through the rest of the material.