VMware Horizon Community
rfisher83
Contributor
Contributor

Default Printer Reverting to Local Printer Upon Login

I know that this is a behavior that has been discussed several times on this forum as well as other sites, but we've tried all of the various workarounds that we've ran across and this issue still affects multiple (seemingly not all) users.

Our users manually find and add their department's printers on our print servers and set the default to their preference.  We have DEM configured to capture these preferences and have confirmed that the correct printer is indeed reflected in the Flex Profiles.reg file.  However, upon logging in, users' default printer is being set to a local virtual printer that is installed on our base image.

During troubleshooting we are not able to duplicate this behavior with our own profiles or test accounts we've created, but affected users claim that this issue occurs the majority of times (if not every time) they log into a new session.

I'm wondering if other shops have found a reliable solution/workaround to this behavior?  This VMware knowledgebase article seems to describe the issue but their workaround doesn't help.. we've tried changing the timeout and even running the command more than once to no avail.  

We've been dealing with this for a few months and have put in several hours trying various suggestions so some fresh input would be greatly appreciated!

 

Reply
0 Kudos
12 Replies
anil_agarwal
VMware Employee
VMware Employee

We provided enhancements to default printer logic in DEM 2103 release. What DEM version are you using? 

Reply
0 Kudos
rfisher83
Contributor
Contributor

We are currently on 2009.  Thank you for your response - I will look into upgrading to 2103 ASAP!

Reply
0 Kudos
rfisher83
Contributor
Contributor

We have upgraded to DEM 2106 in our environment and we are not seeing any improvement.  The default printer is still overriding to a locally installed virtual printer instead of user-specified preferred default printers that are being set in the user's DEM profile.  Are there additional configuration steps needed to reap the benefits of these logic enhancements outside of simply upgrading the DEM agent and ADMX files?

Reply
0 Kudos
anil_agarwal
VMware Employee
VMware Employee

Can you share DEBUG mode FlexEngine log file. Also, do you have printer driver installed in base image? 

Reply
0 Kudos
rfisher83
Contributor
Contributor

In this instance, his default printer did not even get installed, though his other network printer did.  In either case, the locally installed virtual printer was still his default printer despite setting his network printer as default.  The corresponding drivers for the network printers are installed locally on the parent image.

If there is a better, preferred way to post log files please let me know!  

https://pastebin.com/evpMw5jX

 

 

 

Reply
0 Kudos
jmacdaddy
Enthusiast
Enthusiast

Fought this with a customer who was having similar issues.  They use Ricoh printers whose weird drivers cause the printers to take forever to populate in Devices and Printers - long after our profile solution (FSLogix in our case) attempted to apply the default.  

Only way I could get it to work consistently was with logon and logoff off powershell scripts.  The logoff script writes the name of the user's default to a file in Appdata.  FSLogix roams all of Appdata, so it works.  I don't believe DEM roams all of Appdata the same way, so you might want to change that to a different location such as the user's home directory.  The script is deployed as a logoff script (powershell) in a GPO.

Get-default-printer.ps1

Get-WmiObject -namespace root\cimv2 -Query “select * from Win32_Printer Where Default = TRUE” -Impersonation 3 | select -ExpandProperty name | out-file $ENV:UserProfile\appdata\Printer.txt

 

The logon script waits about a minute for the shared printers to fully create on the user's machine and then sets the default based on what got written to the file.  I couldn't get this to work if I deployed it as a logon script in a GPO.   I ended up launching it via a shortcut in the user's Startup folder

Set-default-printer.ps1

Echo "Retrieving your last default printer. Please wait..."
Echo " "
Start-Sleep -s 15
$name=get-content $ENV:UserProfile\appdata\Printer.txt
Echo "Got it. Last default printer was" $name
Echo " "
Start-Sleep -s 10
Echo "Waiting 30 seconds for Printers to propagate before setting default"
Echo " "
Start-Sleep -s 35
Echo "Setting your default printer to " $name
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n $name
Start-Sleep -s 3
Echo "Done!"
Start-Sleep -s 3

 

To create the shortcut, I did use a GPO preference Shortcut.  It looks like:

Target type: File system object
Shortcut path %StartUpDir%\Set Default Printer
Target path C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments -File \\theirdomain.com\dfsnamespacename\PublicIT\Scripts\set-default-printer.ps1

 

I am not a programmer, so don't mock my scripts.  Hope they help.

Reply
0 Kudos
anil_agarwal
VMware Employee
VMware Employee

I am not able to get the file from pastebin. Is it possible to attach the log file here. Here's how you can enable DEBUG logging for a single user: https://kb.vmware.com/s/article/2113514

 

Reply
0 Kudos
rfisher83
Contributor
Contributor

I had to zip it in order to attach it - see attached.  Thanks!

Reply
0 Kudos
rfisher83
Contributor
Contributor

(Replying to jmacdaddy)

This is what we had to do previously to solve the issue when we were using Persona Management with Linked Clone Pools, though we were hoping that VMware would be able to have a supported solution by now with their current profile management...  Ultimately, I suppose that may have to be the last-ditch effort if I can't reach a solution here but I'd really prefer to have DEM work as intended without additional scripts running independent of the DEM profile and agent.  

Reply
0 Kudos
jmacdaddy
Enthusiast
Enthusiast

I agree, but from my experience the issues almost always tend to be driver related and not a problem with the profile management solution.  In our case, we could get the printers to populate immediately after login and have the default always set correctly IF we switched them to use the Ricoh Universal driver.  However, users complained that certain printer functionality wasn't available in the Universal driver so we had to switch back and engineer a solution.

Reply
0 Kudos
anil_agarwal
VMware Employee
VMware Employee

@rfisher83 thank you for sharing the log file. There does not seem any obvious issue from the logs.

 

Horizon has a policy setting "Do not change default printer" in VIP. This policy setting might be worth trying. I am not sure whether this policy setting is available in Horizon 7.13.1 that you are using. I am reaching out to the Horizon team to get details. Will update you soon. Thanks

Reply
0 Kudos
anil_agarwal
VMware Employee
VMware Employee

@rfisher83 I got the response from Horizon folks that "Do not change default printer" policy setting should be available in Horizon 7.13.1. Can you try setting this policy and check if this helps. Thanks

Reply
0 Kudos