A few years ago I discovered how redirected user profile folders in Windows get Recycle Bin protection, even when the folders are redirected to a network location. This was a huge find for me, and I used this feature to add Recycle Bin coverage to some of my mapped network drives. I shared this information on another forum here:
http://forums.mydigitallife.info/threads/16974-Tip-Network-Recycle-bin
Today I figured out a better way to achieve the same goal that doesn't rely on user profile folder redirection, and am sharing that information for other users to try out. You might want to take a look at these forum topics for additional information:
- http://technet.microsoft.com/en-us/library/cc787939(v=ws.10).aspx
- http://blogs.technet.com/b/askds/archive/2012/07/16/managing-the-recycle-bin-with-redirected-folders-with-vista-or-windows-7.aspx
- http://msdn.microsoft.com/en-us/library/bb882665.aspx
- http://social.technet.microsoft.com/Forums/windowsserver/en-US/10bfcfb9-14f3-434e-9ffa-0289b8b32e01/folder-redirection-recycle-bin
The standard disclaimer applies - this might break stuff. I've only tested in Windows 8, and my testing is limited. Try this at your own risk.
This is what I've learned (or think I've learned - I might be wrong):
- Windows Vista and later store the configuration settings for the Recycle Bin for redirected user profile folders in this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder
- Under this key are separate keys for each redirected folder that is protected by the Recycle Bin. The keys contain the configuration information for each protected folder, and are named to match the GUIDs for "Known Folders." A list of the Known Folder to GUID mappings is available in one of the links above.
- The registry also contains a list of "known folders" at this location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions
So, I reasoned that if I could create my own custom "known folder," I could add that to the list of folders that were protected by the Recycle Bin and protect any mapped network drive I wanted. So I looked at the list of existing "known folders" and created a key that was similar to the Documents key. I then fiddled with the values in the key until I narrowed it down to the minimum number needed to make the recycle bin work.
This .reg file will protect a mapped X: drive with a ~50GB recycle bin. You should modify the file to fit your needs:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{9147E464-33A6-48E2-A3C9-361EFD417DEF}] "RelativePath"="X:\\" "Category"=dword:00000004 "Name"="XDrive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{9147E464-33A6-48E2-A3C9-361EFD417DEF}] "MaxCapacity"=dword:0000c7eb "NukeOnDelete"=dword:00000000
A few things of note:
- The GUID in the above .reg file {9147E464-33A6-48E2-A3C9-361EFD417DEF} came from this PowerShell command: "{"+[guid]::NewGUID().ToString().ToUpper()+"}"
- Each "known folder"/Recycle Bin combination requires a unique GUID. If you don't want to use PowerShell to generate a GUID, you can use an online GUID generator.
- I don't know what the "Category" value does, but the key I copied had it set to 4, and that works, so I didn't test any other values.
- The "Name" value is required, but is not the name that will be shown if you right-click on the Recycle Bin and select properties. (At least not in my environment.) In my environment, the name that is shown is the name of the network drive.
- Making this change adds a "Location" tab to the properties page of your mapped network drives. I suspect this could be removed by changing the "Category" value, but didn't bother to find out.
- I only tested with mapped network drives. I suspect this would work with UNC paths as well, but I didn't bother testing.
I hope you're as excited to find this as I was to figure it out. Let me know if this works for you. I now plan to deploy the registry keys with Group Policy Preferences and will update this forum post with any information I discover.
Best regards
--Russel
Update: I am now using Group Policy Preferences to deploy the needed registry keys, and all my mapped network drives are now protected by the recycle bin.
Update 2: I have tested now with UNC paths, and this works fine. I still use mapped network drives, but if your environment requires UNC paths instead, you can use them. Note however that if you have a mapped network drive that points to a UNC path, and you protect the UNC path with a registry change, if a user deletes a file from the mapped network drive that points to that UNC path, the file will be permanently deleted. See below for more details.
- Edited by Russel Riley Friday, September 26, 2014 1:13 PM