Thursday, May 12, 2016

Configuring the recycle bin for redirected folders

Hi all.

Recently, we had the need to disable the recycle bin for all redirected folders. This was due to the fact that the recycle bin - by default - takes a percentage of the volume it is located on, and we redirect to really large volumes, which results in undesirable sizes of these bins... Especially because we charge the users the amount of space they use :-)

Lucky me found a AskDS post that explains the basic steps of managing the recycle bin:

What the AskDS post lacks:
a) What are the folder IDs?
b) How do I deploy the required values?

First, let's determine all the folder IDs. A quick search leads us to which lists each and every known folder in Windows. Not all of them can be redirected, but the most common redirected folders are:


Folders that are rather rarely redirected include:

Start Menu{625B53C3-AB48-4EC1-BA1F-A1EF4146FC19}
Saved Games{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}

For all folders that are redirected we need to create a registry key named with the folder GUID and three values that configure the recycle bin to our needs: Disabled, delete all files - even those that are already present.This requires three REG_DWORD values:
MaxCapacity = 1 (sets the maximum size to 1 MB - zero is not valid)
NukeOnDelete = 1 (delete files immediately)
NeedToPurge = 1 (delete files already present in the bin)

So we have the IDs and the values, now let's deploy them. Create a new GPO and edit, navigate to User Configuration - Preferences - Windows Settings - Registry. Here create three values for each redirected folder as seen in the following screen shot:
The key path is shortened, the full key is Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{FDD39AD0-238F-46AF-ADB4-6C85480369C7} which represents the Personal (Documents) folder.

Repeat this as needed (you can copy and paste), then link your new GPO to your users and enjoy a fresh cool afterwork beer :-))

And if you do not want to disable the bin, but only set its size, do not deploy NukeOnDelete and set MaxCapacity to the size in MB you want.

1 comment:

  1. Before entering the MB value one need to change the Base to Hex in the REG_DWORD.