Deploying Shortcuts, Files and Folders using Group Policy
Using Group Policy, it is entirely possible to deploy shortcuts, files and folders, as well as drive mappings, ini files, registry settings and environment variables. This article will take a look at the items on that list specifically related to the filesystem - shortcuts, files, folders and drive mappings.
Group Policy allows you to deploy files and create folders on computers you are managing without having to visit those PCs manually. You can do this either in Computer Configuration or User Configuration, but we are going to be using User Configuration.
To begin, open Group Policy Editor, and navigate to User Configuration\Preferences\Files, right click on Files and choose New\File.
Create New File
The fields you can fill in are as follows:
This a fairly simple dialog - all you need to do is choose a source file, or files, and enter a destination file, or directory (in the case of multiple source files), and choose what file attributes you wish the new files to have. To demonstrate how this works, consider the screenshot above, then consider what you see on the screenshot below. What we are attempting to do here is copy some fictional XML configuration file from a network loation to the application folder of some fictional application, in effect distributing the entire program's configuration using Group Policy. You could, for example, do this for programs such as Firefox, which have no Group Policy awareness.
Created New File
As you can see, Group Policy did all the hard work here. Because "Some Application" is a fictional application which didn't actually exist on the disk, Group Policy has created the folder structure for us.
Deploying Folders works in much the same way, but you have many more options for when the folder is deleted.
If you wish to create a folder, it works in the same way as creating Files, detailed above. You simply choose the Action (usually Update), and enter a complete folder path which will be created when the policy is next applied. You can set attributes on the folder as you could with the New File dialog.
When you choose the Delete or Replace option for Action, as shown above, you get access to 5 additional options which determine how a folder structure will be deleted (before being replaced, if Replace is the option you have chosen for Action).
You can create shortcuts in the Computer or User section of any Group Policy Object. Creating shortcuts in a Computer policy causes the shortcut to appear to be created whenever anyone logs on to the computer to which the policy applies. Creating shortcuts in a User policy means that the shortcuts are created when a user logs on to whom the policy applies. Additional conditions may take effect depending on where you want the shortcut to appear.
First, open the Group Policy Object (GPO) you wish to edit in Group Policy manager, and navigate to User Configuration \Preferences\Shortcuts. Right click on Shortcuts, and choose New\Shortcut.
Create New Shortcut
The fields in the New Shortcut window are as follows
To demonstrate the workings of this feature, we'll create a URL shortcut which we'll place on the desktop for all users, which will link to a company project tracking system. We have filled in the New Shortcut window as shown below.
Create New Shortcut
Because we've created this shortcut in the User Configuration section of the policy, simply logging on to the computer verifies that the shortcut has been created successfully.
New Shortcut Created