In Domain Environment, where each machine has group policy pushed through the Group Policy Management for disabling USB mass Storage for end users, for maintaining Data security,

In such Environments, Support personnels and administrators often face issues with the need of enabling the USB Mass Storage manually for carrying out any administration tasks which requires the use of a Mass Storage Device. In such cases, based on Domain's Group Policy, it has to be enabled by changing the registry entry and Group Policy on the local Machine. This is often a tedious task, if needed to be done again and again.

Similarly for Sharing, Server service is needed to be started to share a folder on a network. There is a need for some automation for enabling Sharing too. 

So in our environment I created a Batch Script that could make the registry edit and change the group Policy involved to enable the Mass Storage Devices and enable Sharing on a machine.

The Tool basically gives you 6 options to choose from:

Option 1: To enable USB Mass storage devices.

In Windows, there is a registry entry USBSTOR present at HKEY_LOCAL_MACHINE\CurrentControlSet\Services\USBSTOR which is responsible for Allowing/Preventing the USB Mass Storage Devices to be detected on a machine.

In USBSTOR the value of 'Start' Dword decides the same.

Start=4 means USB Mass Storage is disabled.

Start=3 means USB Mass Storage is enabled.

This tool does the edit of this dword and changes it to value 3.

In Windows 7 and above, there is an extra feature added to the group policy that disables the installation of required device drivers for USB Mass Storage Device. In Computer Configuration->Administrative Templates->System->Device Installation->Device Installation restrictions.

which contains group policies for restricting a USB device to install drivers

Prevent Installation of devices using drivers that match these device setup classes

If this policy setting is enabled, Windows is prevented from installing or updating device drivers whose device setup class GUIDs appear in the list created at the domain level.

This tool sets this setting as Not-configured which is default and equal to disabled. Thus allowing the USB devices to install the drivers after getting detected.

Option 2: To Disable USB Mass storage devices.

It does the exactly the reverse of registry edits mentioned above to disable the sharing.

Option 3: To Enable Sharing of folders on the network.

In Windows, there are two services which are required to be running for enabling Sharing, which are Server service and Computer Browser service.

This tool starts those services.

Option 4: To Enable Sharing of folders on the network.

It stops those services.

Option 5: To Enable both

It internally calls the subroutines for enabling both the settings.

Option 6: To Enable both

It internally calls the subroutine for disabling both the settings.

 

You can just run the exe file in ZIP file downloaded and there you go.

You can download the tool from this link

enableusbandshare.zip

The batch script used to enable is also attached in the ZIP file.

I am new to this forum, so you can revert to me in case of any comments, you are always welcome.