Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


January 2009

Redirect More Folders

A registry tweak is all it takes
RSS
Subscribe to Windows IT Pro | See More Active Directory (AD) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A nice feature of Active Directory’s (AD’s) Group Policy Objects (GPOs) is folder redirection, which was introduced in Windows 2000. In folder redirection, special folders typically found on users’ local computers are moved to a server. This is often done to ensure those folders will be backed up regularly. However, Windows restricts its use to only four user folders—Application Data, Desktop, My Documents, and Start Menu—without giving you an option to redirect other folders.

Sometimes companies might want to redirect other special user folders. A common scenario is a company that doesn’t want to use roaming profiles because they make clients heavily dependent on file servers, consume a lot of bandwidth, and use a lot of server disk space, but the company finds that redirecting only the four folders is inadequate. Redirecting other folders such as Cookies, Favorites, Recent Files, and SendTo consumes little disk space but offers the advantage of saving users a lot of time because these folders are available on all computers they log on to.

Although you can’t use GPOs to redirect more folders, you can redirect them by tweaking the registry. Settings for users’ special folders reside in the HKEY_CURRENT _USER\Software\Microsoft\Windows CurrentVersion\Explorer\Shell Folders and HKEY_CURRENT_USER\Software\Microsoft Windows\CurrentVersion\Explorer\User Shell Folders keys. To achieve redirection, you must tweak both keys at the same time.

For example, suppose you want to move the Favorites folder from users’ local machines to your server. All you have to do is follow these steps:

1. In the Shell Folders and User Shell Folders keys, set the Favorites entry to the value of \\ServerName RedirectedFolders\%username%\Favorites, where ServerName is the name of the server on which the Favorites folder will reside. Note the %username% variable in the value. By using this variable instead of hard-coding a user’s name, you can use a logon script to change the registry settings in many machines.

2. Export the settings for the Shell Folders and User Shell Folders keys to a .reg file. Delete all but the Favorites settings, so that the .reg file looks like that in Figure 1.

3. Copy the .reg file to a shared folder on the DC, such as a folder created for scripts and their associated files.

4. Create the following logon script to import the .reg file into the registry:

net use X: "RegFilePath"
reg.exe import X:\RegFile
net use X: /d /y

where X is the drive on which the .reg file is stored (e.g., Z), RegFilePath is the path to the .reg file (e.g., \\DC1\Scripts), and RegFile is the name of the .reg file (e.g., Favorites.reg). This script uses the Net Use command to connect to the shared folder containing the .reg file. After the connection is made, the reg.exe import command copies that file’s contents into the registry. Finally, the script uses the Net Use command to delete the connection that was temporarily created.

Alternatively, you can use a logon script that contains only one line:

reg.exe import RegFile

In this case, RegFile needs to contain the full pathname to the .reg file (e.g., \\DC1 Scripts\Favorites.reg).

5. To run this script, create or open an existing GPO, then navigate to User Settings\Windows Settings\Scripts\Logon. Add the script to the Logon scripts dialog box. Close the GPO.

Although there are other ways to make these registry changes (e.g., creating your own .adm files, using Windows Management Instrumentation’s System Registry provider in a .vbs script), I prefer this method because of its simplicity. I successfully used it to redirect the Favorites, SendTo, and Recent folders from many Windows XP machines to a server. Before you deploy this solution, be sure to thoroughly test it.

—Apostolos Fotakelis, systems administrator,
Aristotle University of Thessaloniki,
and freelance IT consultant

End of Article



Reader Comments
I think Desktop, Document, and Favorites are worth redirected to the server; the rest -- Application Data, SendTo, Cookies and Recent Files -- are not necessary to be stored on the server.

This restriction is removed in Windows Server 2008, which allows redirects Application Data, Desktop, Start Menu, Documents, Pictures, Music, Videos, Favorites, Constacts, Downloads, Links, Searches and Saved Games.

Redirecting Desktop to a server share causes a slowness to a user if the user stores lots of files and folders on the desktop. However, it's the case if a GIG network is implemented.

rctks2 February 03, 2009 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Understanding File-Size Limits on NTFS and FAT

A general confusion about files sizes on FAT seems to stem from FAT32's file-size limit of 4GB and partition-size limit of 2TB. ...


Related Articles Registry Reading and Writing Made Simple, Part 1

101 One-line “How Can I?” Scripting Commands

How can I pass a percent sign (%) value to reg.exe?

Folder Redirection

Active Directory (AD) Whitepapers Meeting Compliance Objectives in SharePoint

Email Controls and Regulatory Compliance

Related Events Delegating Group Policy Management: What you don't know can hurt you

WinConnections and Microsoft® Exchange Connections

Troubleshooting Active Directory

Check out our list of Free Email Newsletters!

Active Directory (AD) eBooks The Essentials Series: Active Directory 2008 Operations

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Windows 2003: Active Directory Administration Essentials

Related Active Directory (AD) Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement