[PowerShell] Enable/Disable access to removable storage

wrote a script for a customers network administrator to enable and disable access to removable storage. In the example below I used the registry keys for the Removable Disks: Deny write access and Removable Disks: Deny read access Group Policy Objects. It is easier to fix this with Group Policy if the computers are domain joined, you can set the policy in Computer Configuration > Administrative TemplatesSystem > Removable Storage Access.

removablestoragegpo

Note: The script below is only tested on Windows 10, version 1511. Use it as reference for your own environment.

Download: Block-USB.zip 1.2 KB ( 1269 bytes )
SHA256: ed87ea7332df0a8dada6d902790d15b2e753f65cef0bb9463156ad0953af37bb
VirusTotal: link

removablestorageps