Monday, April 20, 2009

Group Policy Folder Redirection

Group Policy has folder redirection built into it, but imo it's not sufficient for all the redirect needs that can be found in a Terminal Server environment. To compensate I wrote my own template with folder redirection.

In this template I included some folders that shouldn't be redirected (Local Settings). I did this because in some environments I had found that the settings for these locations had already been redirected, usually by a login script.

Obviously the pathing needs changed to reflect the environment. Other settings such as My Documents, etc which are provided by MS should be used as they have additional functionality such as copying from the current location on redirection.

Don't forget to use this with Loopback Policy so that it only applys to your Terminal Servers. Otherwise you will have a mess with your laptops / desktops.
CLASS USER

CATEGORY "Custom Folder Redirection"
KEYNAME
"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"

POLICY "Application Data"
EXPLAIN "When enabled this policy
redirects the 'Application Data' folder to the path specified. You can use
either a UNC or drive path."
PART "Path to where you want the Application
Data Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT
"U:\TSProfile\Application Data"
VALUENAME "AppData"
END PART
END
POLICY

POLICY "Cache"
EXPLAIN "When enabled this policy redirects
the 'Temporary Internet Files' folder to the path specified. You can use either
a UNC or drive path."
PART "Path to where you want the Temp Int Files Folder
redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "%Userprofile%\Local
Settings\Temporary Internet Files"
VALUENAME "Cache"
END PART
END
POLICY

POLICY "Favorites"
EXPLAIN "When enabled this policy
redirects the 'Favorites' folder to the path specified. You can use either a UNC
or drive path."
PART "Path to where you want the Favorites Folder
redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT
"U:\TSProfile\Favorites"
VALUENAME "Favorites"
END PART
END POLICY

POLICY "History"
EXPLAIN "When enabled this policy redirects the
'History' folder to the path specified. You can use either a UNC or drive path."
PART "Path to where you want the History Folder redirected." EDITTEXT
EXPANDABLETEXT REQUIRED
DEFAULT "%Userprofile%\History"
VALUENAME
"History"
END PART
END POLICY

POLICY "Local AppData"
EXPLAIN
"When enabled this policy redirects the 'Local AppData' folder to the path
specified. You can use either a UNC or drive path."
PART "Path to where you
want the Local AppData Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "%Userprofile%\Local Settings\Application Data"
VALUENAME "Local
AppData"
END PART
END POLICY

POLICY "Local Settings"
EXPLAIN
"When enabled this policy redirects the 'Local Settings' folder to the path
specified. You can use either a UNC or drive path."
PART "Path to where you
want the Local Settings Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "%Userprofile%\Local Settings"
VALUENAME "Local Settings"
END PART
END POLICY

POLICY "NetHood"
EXPLAIN "When enabled
this policy redirects the 'NetHood' folder to the path specified. You can use
either a UNC or drive path."
PART "Path to where you want the NetHood Folder
redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "U:\TSProfile\NetHood"
VALUENAME "NetHood"
END PART
END POLICY

POLICY "PrintHood"
EXPLAIN "When enabled this policy redirects the 'PrintHood' folder to the
path specified. You can use either a UNC or drive path."
PART "Path to where
you want the PrintHood Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "U:\TSProfile\PrintHood"
VALUENAME "PrintHood"
END PART
END POLICY

POLICY "Programs"
EXPLAIN "When enabled this policy
redirects the 'Start Menu Programs' folder to the path specified. You can use
either a UNC or drive path."
PART "Path to where you want the Start Menu
Programs Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT
"U:\TSProfile\Start Menu\Programs"
VALUENAME "Programs"
END PART
END
POLICY

POLICY "Recent"
EXPLAIN "When enabled this policy redirects
the 'Recent' folder to the path specified. You can use either a UNC or drive
path."
PART "Path to where you want the Recent Folder redirected." EDITTEXT
EXPANDABLETEXT REQUIRED
DEFAULT "U:\TSProfile\Recent"
VALUENAME "Recent"
END PART
END POLICY

POLICY "SendTo"
EXPLAIN "When enabled
this policy redirects the 'SendTo' folder to the path specified. You can use
either a UNC or drive path."
PART "Path to where you want the SendTo Folder
redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "U:\TSProfile\SendTo"
VALUENAME "SendTo"
END PART
END POLICY

POLICY "Startup"
EXPLAIN "When enabled this policy redirects the 'Startup' folder to the path
specified. You can use either a UNC or drive path."
PART "Path to where you
want the Startup Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT "U:\TSProfile\Start Menu\Programs\Startup"
VALUENAME "Startup"
END PART
END POLICY

POLICY "Templates"
EXPLAIN "When enabled
this policy redirects the 'Templates' folder to the path specified. You can use
either a UNC or drive path."
PART "Path to where you want the Templates
Folder redirected." EDITTEXT EXPANDABLETEXT REQUIRED
DEFAULT
"U:\TSProfile\Templates"
VALUENAME "Templates"
END PART
END POLICY

END CATEGORY

No comments:

Post a Comment