Typically printer installation is done in the enterprise via login scripts that are based on usernames. This works fine in most cases, however, I recently began looking into a better way to do this.
The problem with installing printers based on usernames is that on a given day a teacher or student can log into as many as three or four different computers in various locations throughout a school. With this being the situation, we could for instance map the printer “GCHS-MATHLAB” to a student active directory account, but then when the student walks into the business lab, he will still be printing to the math lab. The obvious reaction to this would be to setup a script that installs all avaliable printers in the building for the student, however this creates an unneccesary security risk, and would allow students to print into room they are not located in which could cause trouble.
My first instinct for a solution was to install printers based on the active directory organizational unit by pushing a machine startup script. This would work perfectly as our active directory is for the most part organized by a computers physical location in a school. A machine startup script which can be found in the group policy editor under Computer ConfigurationWindows SettingsScriptsStartup is different from a login script as it is run on the target machine before a user even logs into a computer. After creating a GPO with my printer installation script set as a startup script I linked the GPO to a test OU where I began my testing. Unfortunatly, this setup didn’t seem to want to work. When the computers in the OU would boot up I would recieve a message stating the access was denied to add the printer. I knew that the problem was not with permissions accessing the script, because the error it gave me was actually on the 5th line of the script, so I know it was getting appropriate access to the file. The line it gave me the error on was the actual line that connected to and installed the printer. Sure enough, the “domain computers” group was added to the specific printers ACL, so that wasn’t the issue either. I had eventually determined that the issue with installing the printer this way was by design in windows as printers are typically managed in a user based context rather than a machine based one.
After a week or so of more research, I was about to give up when I stumbled upon some Microsoft documentation regarding something called Loopback Processing. In using loopback processing, you define settings for the User Configuration context of the group policy editor. After you finish setting these policies, browse to Computer ConfigurationAdministrative TemplatesSystemGroup Policy and select the policy called “User Group Policy Loopback Processing Mode”. Once you enable this policy you have two options to choose from. The first option is the “Merge” mode, which processes all user configuration policies as if they were machine policies AFTER whatever machine configuration policies that already exist are applied. The “Replace” mode however, does not process existing machine configuration policies, and only executes the user configuration policies. With this knowledge in hand I configured my printer installation script as a login script for group policy user configration, enabled user loopback processing merge mode, and sure enough, it worked like a charm.
A week or so removed from the discovery of loopback processing mode, I have found several other uses for it. I am actually considering changing site based drive mappings from being mapped via user defined scripts to being mapped via a group policy invoked script in order to avoid issues with teachers and faculty who roam among various schools in the district. I am also currently expiramenting with extending Mandatory user profiles via user loopback processing, so be sure to check back for my findings on that.
For more information regarding loopback processing, see the related Microsoft KB# 231287