Block Unknown USB Block Unknown USB

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.

  • Editorial Team
  • Last verified: November 2026
  • 14 min read
Quick answer

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.

At a glance
Works onWindows 11 Pro, Enterprise, Education and Home
Time needed5 to 15 minutes for one PC
You needAn administrator account and a spare test drive
CostFree with built-in tools, or software for lists and logs
UndoReverse one setting, then restart
Unknown USB drive stopped at a Windows 11 laptop portIllustration of a laptop with a USB flash drive approaching its port and a shield with a question mark and a red stop mark in front of it.?Unknown deviceStorage blocked, keyboard and mouse keptWindows 11 PC

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.

Only for PCs you control

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.

You can skip some of this

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.

Which control method fits one PC, several PCs or an allow listGrid with three methods as rows and three needs as columns, using check marks and crosses to show the usual fit.One PCSeveral PCsNeeds allow listGroup PolicyRegistrySoftwareRough fit by scope. Group Policy needs Pro, Enterprise or Education.
What a USB storage block covers, and what it leaves alone.

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.

Which USB control covers which device classThree rows comparing a storage rule against a disk class and a keyboard class, and a class allow list against keyboards.What each control looks atStorage ruleDisk classStops a flash driveStorage ruleKeyboard classDoes not applyClass allow listKeyboard classCan hold new keyboardsA device that announces two classes needs a rule for each
Three ways an unknown USB device causes trouble, and which control addresses each.

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.

Myth

Blocking USB ports turns off every port on the PC.

Fact

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 class cheat sheet

Device class and the control that applies
DeviceWindows classRemovable storage denyUSBSTOR offInstallation rules
USB flash driveDisk drivesBlockedBlockedCan be allowed by ID
External hard diskDisk drivesBlockedBlockedCan be allowed by ID
Keyboard or mouseHuman Interface DevicesNot affectedNot affectedBlocked only if class is denied
PrinterPrintersNot affectedNot affectedClass rule needed
Phone, camera (MTP or PTP)Windows Portable DevicesNeeds the WPD settingNot affectedClass rule available
Charging onlyNoneNot affectedNot affectedPower is not controlled
TakeawayStorage rules are narrowSafe for keyboardsSafe for keyboardsBroadest 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 picker

Choose your answers, then press the button.
Methods to block unknown USB devices in Windows 11
MethodEditionsPrecisionApproved listLogEffort
Group Policy: Removable Storage AccessPro, Enterprise, EducationStorage and portable device classesNoNoLow
Registry Deny_All valueAll editionsSame policy as above, set by handNoNoLow
USBSTOR service Start = 4All editionsDisables the storage driverNoNoLow, but crude
Device Manager: disable a deviceAll editionsOne device at a timeNoNoHigh
Device Installation RestrictionsPro, Enterprise, EducationBy class or hardware IDYes, by IDEvent log onlyHigh
USB blocking softwarePer productStorage control with passwordYesUsuallyLow
Our readingPolicy firstRegistry on HomeLast resortNot for blockingUse for lists and logsSoftware for lists
Three ways to control USB devices side by sideIllustration of a USB stick with dashed lines leading to three cards labeled Group Policy, Registry and Software.Group PolicyPro and up{ }RegistryAll editionsSoftwareAllow list
The methods side by side, from broad to precise.
Why Device Manager is the wrong tool

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.

  1. Open the Group Policy editor

    Press Win + R, type gpedit.msc and press Enter.

  2. Go to Removable Storage Access

    Open Computer Configuration, Administrative Templates, System, then Removable Storage Access.

  3. Enable the deny rule

    Open All Removable Storage classes: Deny all access, choose Enabled and press OK.

  4. Apply and restart

    Run gpupdate /force in an administrator terminal, then restart the PC.

  5. 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.

Command builder

Direction
PowerShell as Administrator
Back up before editing the registry

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.

Four checks to confirm an unknown USB device is blockedFlow of four boxes: plug in the drive, look at the device list, read the event log, and compare the result with the policy.Plug inunknown driveDevice listerror or no driveEvent logentry recordedResultblocked or allowedCheck in this order, on the same PC
The order of the steps: prepare, apply, restart, test.

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.

Order in which Windows evaluates device allow and prevent rulesDiagram of four stacked bars narrowing from device instance IDs to device IDs, device setup classes and removable devices.1. Device instance IDsmost specific2. Device IDs3. Device setup classes4. Removable devicesbroadestEvaluated top to bottom when layered order is enabled
Layered order of evaluation: allow rules are checked before a catch-all prevent rule.
  1. Collect the IDs

    In Device Manager, open each device you want to keep, then Details, Hardware Ids. Copy the strings.

  2. Allow the classes you rely on

    Allow Human Interface Devices before anything else so a keyboard and mouse survive.

  3. Add allowed IDs

    Enable allow installation of devices that match any of these device IDs and paste your approved list.

  4. Prevent the rest

    Enable the prevent installation setting and tick the layered order option so allow rules win.

  5. Apply to installed devices

    Tick the matching option if the rule must also reach devices already installed, and test a second keyboard first.

Keep a way back in

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.

  1. Download the installer

    Get USB Block from the official download, or read the product page first.

  2. Install and set a password

    Run the installer as administrator, then set the control password. Without it, any user can switch the protection off.

  3. Choose what to block

    Turn on protection for USB storage devices and, if needed, other classes such as CD and DVD drives.

  4. Add approved drives

    Connect each approved drive once and add it to the list.

  5. Check the log and test

    Plug in an unlisted drive, confirm it is refused and read the entry in the log.

USB Block protection switches for storage and other device types
The protection switches in USB Block.
Windows 11 compatibility

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.

Ways to keep an approved list
ApproachHow it identifies a driveWeak point
Device ID allow ruleHardware ID from Device ManagerMany cheap drives share an ID
Instance ID allow ruleSerial based pathBreaks if the port path changes
Software listProduct's own device recordDepends 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.

Approved list gate that lets known drives open and keeps unknown drives blockedDiagram of an approved list feeding a gate with one arrow to open and another to blocked.Approved listKnown drivesGateOpenBlocked
An approved list works like a gate: known devices pass, the rest stop.

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.

  1. Use a brand new drive

    A drive that was mounted before can keep its driver. A new one shows what the rule really does.

  2. Read the policy value

    In Registry Editor open the RemovableStorageDevices policy key and confirm Deny_All is 1.

  3. Run gpresult

    In an administrator terminal run gpresult /r and check that the policy applies to the computer.

  4. Check Device Manager

    Look under Disk drives and Universal Serial Bus controllers to see whether the device enumerated.

  5. 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.

Sample of Windows event log rows that record a USB device arriving and leavingA table with time, event number and meaning columns listing events 2003, 2100 and 2102.TimeEventMeaning09:142003Driver loaded for device09:142100Power or Plug and Play change09:412102Device removedEvent IDs from the DriverFrameworks-UserMode operational log
What to look for when checking the log.
USB Block access log tab with a record of USB activity
A product access log is an easy way to see blocked attempts.

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.

Myth

If it is blocked in Device Manager, it is blocked everywhere.

Fact

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, cause and fix
ProblemLikely causeFix
Drive still opensDrive was already installed or policy not appliedRun gpupdate, restart, test with a new drive
Keyboard stopped workingClass rule too broadBoot to recovery, undo the rule, allow the HID class
Policy greyed out or missingWindows HomeUse the registry method
Phone still transfers filesWPD class not deniedEnable the WPD deny setting
Rule revertedDomain or Intune policy overwrote itChange the rule at the managing policy
Drive appears, access deniedRule is workingNothing 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.

USB exposure score

Do strangers or visitors use this PC?
Does it hold client or personal data?
Are USB storage ports open today?
Is the drive left unencrypted?
Is there no log of what connects?

Answer the questions, then press the button.

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.

USB Block product box
About the publisher. NewSoftwares.net develops Windows security tools for folder locking, USB protection and data privacy.
USB Block password settings screen
Password settings stop other users from switching the block off.

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.