Ref Site : Blog.Technet.Com

Disable Adding USB Drive and Memory Sticks via Group Policy and Group Policy Preferences

If you do not have Group Policy Preferences installed see Install Group Policy Preferences. This link tells you how to do it in a 2003 domain.  In a 2008 domain it is much easer as all you have to do is enable the feature.  See "The Steps" section below if you need a step by step. 

Our objective is to prevent users from being able to take data away with them by plugging in a USB drive or memory stick. Due to the way that windows works and specifically order of precedence on when things run we have to "lock down" two different components.

A) Group Policy Preference:

Group Policy Preference: Change Registry Value: HKLMSYSTEMCurrentControlSetServicesUSBSTORStart (4=Disable USB Drives; 3=Enable USB Drives). This setting will change the registry USB Drive Start Value to 4 which is disabled. Thus, the USB Drive is not allowed to be installed. There is a limitation of this policy. That is, it only does it’s job if the driver is already installed. If the driver is installed after the policy is executed, windows automatically changes the value back to 3 upon driver installation. Therefore, when using this setting, you must also pair it with the setting to disable the installation of the driver USBSTOR.

How to do this: From your Vista machine with Group Policy Preferences installed or from a Windows Server 2008 machine with Group Policy Management Tools Installed. StartControl PanelAdministrative ToolsGroup Policy Management Tools. Open a group policy that you want to add these setting to (or create a new one). Edit the policy and expand User ConfigurationPreferencesWindows Settings. Right-Click on Registry select New from the drop down menu then select Registry Item. In Fill out the form as indicated in the screen shot of Group Policy Preference A Main .  The items you need to select are as follow:

General Tab:

  • Action: Replace
  • Hive: HKEY_LOCAL_MACHINE
  • Key Path: SYSTEMCurrentControlSetServicesUSBSTOR
  • Value Name: Start
  • Value Type: REG_DWORD
  • Value Data: 4    -> if you want to turn this off later, change the value back to 3

Common Tab:

  • Description: 

    Changes Registry Value: SYSTEMCurrentControlSetServicesUSBSTORStart   (4=Disable USB Drives; 3=Enable USB Drives)

    This setting will change the registry USB Drive Start Value to 4 which is disabled. Thus, the USB Drive is not allowed to be installed. There is a limitation of this policy.  That is, it only does it’s job if the driver is already installed.  If the driver is installed after the policy is executed, windows automatically changes the value back to 3 upon driver installation.  Therefore, when using this setting, you must also pair it with the setting to disable the installation of the driver USBSTOR.INF.  This can be done via group policy "Computer ConfigurationPoliciesWindows SettingsSecurity SettingsFile System" and denying access to users that should not have access to drives.

    See http://blogs.technet.com/danstolts/archive/2009/01/21/disable-adding-usb-drive-and-memory-sticks-via-group-policy-and-group-policy-preferences.aspx for details

  • Turn On Item-Level Targeting and click Targeting
  • At the top of the targeting editor screen click New Item then Select Security Group
  • On the Targeting Editor Screen for Security Groups click the Browse button and type in the group of users (in my case "Deny USB Drive") that you want this to apply to then click Check Names
  • Click OK all the way out

Click the links for screen shots:

001

002

003

004

I strongly recommend you click on the Common tab and copy and paste the description above into the description field

B) Group Policy:

This can be done via group policy "Computer ConfigurationPoliciesWindows SettingsSecurity SettingsFile System" and denying access to users that should not have access to drives.  At this location add the files "%SystemRoot%infusbstore.inf" and ""%SystemRoot%infusbstore.pnf" and set permissions so users that you do not want to be able to install drives, cannot read the files.  You can do this this second piece in one of two ways.  You can deny access by adding the group and selecting deny or you can simply not allow access by removing the users from the security list.  Keep in mind that when you apply this policy it will OVERWRITE the permissions on these files for all machines where the policy is applied. For this reason, you will no longer have "local" access to the files when you login using a non-domain account.  Usually when you want to turn this setting on this is an acceptable side effect because you do not want to give users any method of getting there including logging in as a non-domain user.  Click link for screen shot of Group Policy Preference B

I have been thinking about created a step by step video of this process.  If that would be beneficial to you, let me know and I will try to make it happen.  In a nutshell the process is as follows:

The Steps:
  1. Install Group Policy Preferences (if they are not already installed).  If you are on a Windows 2008 domain you only need to add the Group Policy Management feature using server manager.
  2. Make sure all clients have Group Policy Preferences in Windows Server 2008 Client Side Extensions installed
  3. Create a security group of "users or computers" that will have USB drive install blocked.  In my example I called it "Block USB Drive Install". Add computers and users to above group – This group will be used in Item Level Targeting
  4. Create a group policy with the settings outlined in Section A and B above
  5. Setup the Links and Security of the Group Policy to apply to the proper users and computers
  6. Apply the group policy (apply to a test group / OU first) test and let me know if you have any problems with these instructions
  7. Make sure that you reboot the destination computers before testing.  The "policy" part of this will only be applied after a reboot.
Additional Comments and Security Alerts:

By using this method of applying the policy, a non-deny user can login to the machine and run the "Net Start USBStor" from the command line and then insert the USB drive and it will work.  Be advised though that the Computer part of the policy applies prior to login so you will have to login with the correct credentials of a user that has access and then reboot the computer (or do "gpupdate /force" from the command line).  However, when you are done, remember that the computer setting is done before you login so the next time a deny user logs in they may have access to these features until they reboot the computer and the policy is "re-applied" with their credentials.  To avoid this situation, I recommend you try to avoid using USB drives from a machine where the typical user does not have access to USB.  This way you will not "accidentally" give them temp access to the feature.  If you must use a USB drive on this system just remember to login as a deny user and then "reboot" the workstation to confirm that the security profiles are correct.

If you need to remove the Group Policy, remember the security rights of the files that you changed the security of will NOT change back to the original.  Therefor, you will want to change the policy to remove the deny user group and make sure the policy gets applied to all workstations before removing it.  Even if you do this, the "local Users" will not necessarily have rights unless you specifically go back to the machine and give them rights.

A Knowledge Base article was posted with the manual steps to disable adding usb drives to a machine. However, I wanted to share a way to "automate" this process using Group Policy and Group Policy Preferences. There are more ways to accomplish this task but this one is easy to implement and will teach you about some features in Group Policy and in Group Policy Preferences that are not often used. If you want to see the manual process for disabling access or install of USB drives (memory sticks, etc) check out KB article 823732 from http://support.microsoft.com/kb/823732

So that you have the text from the GP that I created in preparing this content, I have put a copy of the report of the resulting GPO below

Dan Stolts Blog   Disable Adding USB Drive and Memory Sticks via Group Policy and Group Policy Preferences

Published Wednesday, January 21, 2009 7:35 AM by Dan Stolts