Setting default printers in Environment Manager fails when Location Aware Printing is enabled

Version 1

    Verified Product Versions

    AppSense Environment Manager 8.6AppSense Environment Manager 8.5AppSense Environment Manager 8.4AppSense Environment Manager 8.2AppSense Environment Manager 8.1AppSense Environment Manager 8.3AppSense Environment Manager 8.0

    Introduction

    If Location Aware Printing is enabled you may find that you are unable to set the default printer via an Environment Manager logon action.

    Location Aware Printing is a feature on Windows 7 Professional and higher mobile devices which enables users to set their default printer depending on which network they are connected to. For example, the user can configure Location Aware Printing so that their default printer automatically changes depending on whether they are connected to their corporate or home network. See http://blogs.technet.com/b/askperf/archive/2009/10/10/windows-7-windows-server-2008-r2-location-aware-printing.aspx for more information.

    You can check to see if you have Location Aware Printing enabled by selecting a printer in the Devices and Printers folder and then clicking 'Manage Default Printers'. Location Aware Printing is enabled if 'Change my default printer when I change networks' is selected.

    Detail

    In these situations Environment Manager is setting the default printer correctly; however, after these settings are applied spoolsv.exe applies the Location Aware Printing settings and overwrites those made by Environment Manager.

    You can confirm this behaviour by capturing a Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) log of the logon process. Note the times in the following example log lines, which show EmUser setting the value to Printer1 and then spoolsv overwriting this and setting it Printer2.
     
    11:23:30.4209459 EmUser.exe RegSetValue HKU\S-1-5-21-5421164785-1547853695-1359845674-14458\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device SUCCESS Type: REG_SZ, Length: 16, Data: \\share\Printer1:
    11:23:41.2538010 spoolsv.exe RegSetValue HKU\S-1-5-21-5421164785-1547853695-1359845674-14458\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device SUCCESS Type: REG_SZ, Length: 16, Data: \\share\Printer2:

     

    In order to resolve the problem either disable Location Aware Printing (which is superfluous if you are using Environment Manager to manage default printers) or move the Environment Manager default printer actions to another trigger (for example as Process Start actions for explorer.exe) which will be applied after the Location Aware Printing settings.