Removable media restrictions sticking on to deviceSolved

Participant
Discussion
2 weeks ago

Hola guys,

I created a PowerShell script to block all removable storage devices, which successfully restricted USB access. However, when I tried modifying the script to allow access again, the devices still remained blocked.

Here’s the script I used to block USB access:

The issue is that even after removing these registry keys, the restrictions seem to persist, and the keys reappear after a while. I’m looking for a way to regain access to USB through a script. Has anyone faced this before or knows how to fix it?

Any help would be appreciated!

Replies (3)

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

Hey @yu-yan ,

Yes, the registry key you’re modifying — HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices is responsible for enforcing removable storage restrictions like USB access. When you set Deny_All, Deny_Read, or Deny_Write to 1, access is blocked as expected.

However, if you’re finding that deleting or modifying the key (like setting Deny_All to 0) doesn’t restore access, it’s likely due to the policy still being enforced at the system level. In some cases, registry-based restrictions can persist or be recreated after reboot if the device is syncing with a management system.

Here’s what you can try:

  1. Delete the entire registry key used for blocking removable storage.
  2. After deleting the key, restart the device to ensure the change takes full effect.

Let me know if this helps you regain access!

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

Thank you @roger for the help it did work after the following the steps you mentioned. I need more help. Is there any other way to restrict/allow access to removable settings?

Marked SolutionPending Review
Hexnode Expert
1 week ago
Marked SolutionPending Review

Hello @yu-yan,

Thank you for reaching out. Yes, apart from using PowerShell scripts, you can manage removable storage access directly through Hexnode’s Media Management policy for Windows devices. This allows you to centrally restrict or allow access to all removable media types from the Hexnode portal, without needing to manually modify registry keys.

You can check out our detailed help doc on configuring media management settings for Windows devices.

Feel free to reach out to us if there are any issues.

Regards,
John Cooper
Hexnode UEM

Save