Kaseya Community

Disable the use of USB Mass storage devices/Pendrives

  • This script will stop windows being able to user USB pen drives and mass storage devices, without the need to stop USB support in the BIOS.

    Script Name: Disable USB Mass Storage
    Script Description: Disables USB Mass Storage devices

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start
    Parameter 2 : 4
    Parameter 3 : REG_DWORD
    OS Type : 0
    ELSE

    The script below enables USB storage again

    Script Name: Enable USB Mass Storage
    Script Description: Enables USB Mass Storage Devices

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start
    Parameter 2 : 3
    Parameter 3 : REG_DWORD
    OS Type : 0
    ELSE


    Legacy Forum Name: Disable the use of USB Mass storage devices/Pendrives,
    Legacy Posted By Username: jnuttall
  • This script works great -- is there any way to do something similiar with CD-ROMS and Floppy drives?



    edit --

    I realized how easy of a question this actually was.
    I now have the ability to block CD-ROMS, FLOPPIES, and USB STORAGE DEVICES.

    Cool


    Simply change:
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUsbStorStart
    to
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesCdromStart
    or
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesFlpydiskStart


    Works great.






    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: cscovil