1 2 Previous Next 16 Replies Latest reply on Sep 16, 2020 11:02 AM by joshuarupp

    Default printer is not remembered in VDI

    eXPlosionas Novice

      Hi,

       

      we have vmware vSphere6 and VDI desktop infrastructure. Every time user loggs in into VDI his default printer is not the printer which it made default in previous login. Vm pool is Automated Desktop Pool with source vCenter (linked clone). This happens on win8 or win10, it doesn't matter.

      I found this in discussion:

       

      I found the sollution eventually.

       

      Its realated to the "network location awareness" service

       

      2 options:

      [s]1. (for every user) disable the "Network Location Awareness" Service in the services console and include it in your gold image

      (i believe its related to: every guest generates there own network ID, if the ID is different NLA sets the default printer to the system default (which in my case is the PDF creator)[/s] (sorry guys, this was NOT the sollution)

       

      2. If you do not want to disable the NLA service,  Do it on a per-user base in the current user registry (see below)

       

      Create a Key in HKEY_CURRENT_USER\Printers ... named: Defaults

      Then create an entry (string value): Disabled and set it to: 1

       

      --- printer_per_user.reg ----

      Windows Registry Editor Version 5.00

      [HKEY_CURRENT_USER\Printers\Defaults]
      "Disabled"="1"

       

      but registry editing and disabling service didn't helped. Any more ideas?

        • 1. Re: Default printer is not remembered in VDI
          cH1LL1 Enthusiast

          Use Client Side Preferences:

          Group Policy:

           

          User Configuration:>Preferences>Control Panel Settings>Printers> Shared Printer>

          Set the printer as a default Printer> True

          Only if a local printer is not present: True/False

          You can also item level target this to a security group of users or a OU where your users are based./

          Departmental/ Office etc.

           

           

          there is another way...if you dont want to use Client Side preferences

           

          Essentially you are going to create a script to write your currently saved  default printer to a network drive upon logoff.

          then upon logon you will create a scheduled task to copy that default printer info from text file back in to the registry.

          this is an exact copy of the script we are using to do this today across 650 vms

           

          Save Printer script:

           

          Dim objFSO 'As FileSystemObject

          Dim objTextFile 'As Object

           

          Set oShell = CreateObject("WScript.Shell")

          strValue = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"

          strPrinter = oShell.RegRead(strValue)

           

          Set objFSO = CreateObject("Scripting.FileSystemObject")

          Set objTextFile = objFSO.CreateTextFile("p:\defaultPrinter.txt", True)

          objTextFile.Write (strPrinter)

          objTextFile.Close

           

           

          Restore Printer Script:

           

          On Error Resume Next

           

          Set objFSO = CreateObject("Scripting.FileSystemObject")

          Set objFile = objFSO.OpenTextFile("p:\defaultprinter.txt", 1)

           

          If Err.Number <> 0 Then

            wscript.echo("Quiting")

            WScript.Quit

          End If

           

          Dim arrFileLines()

          strPrinter = objFile.ReadLine

          objFile.Close

           

          Set oShell = CreateObject("WScript.Shell")

          strKey = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"

          oShell.RegWrite strKey, strPrinter, "REG_SZ"

          • 2. Re: Default printer is not remembered in VDI
            eXPlosionas Novice

            Is it ok to use it together with:

            --- printer_per_user.reg ----

            Windows Registry Editor Version 5.00

            [HKEY_CURRENT_USER\Printers\Defaults]
            "Disabled"="1"

            • 3. Re: Default printer is not remembered in VDI
              VMMalley Novice

              another more drastic approach is to uncheck the remote printer deal during install of the 32/64 bit Horizon View agent.

               

              This also works, but you lose the capability to have a locally connected printer if running from a standard PC or from home via your security server.

              • 4. Re: Default printer is not remembered in VDI
                eXPlosionas Novice

                The printer is remembered now, but when going to file -> print in word or excel it just hangs. The same happend when i want to open printers and devices. The control panel window freezes. This happened before the registry manipulation. It happens mostly on few VDI's. I don't know what to look for.

                • 5. Re: Default printer is not remembered in VDI
                  eXPlosionas Novice

                  Everytime i check this logof logon script in vSphere client it works, printer is set, but when in the morning our employee comes and logs in to vdi it's not saved as default printer. Maybe i should set some delay to script because maybe boot process have not completed fully

                  • 6. Re: Default printer is not remembered in VDI
                    CyberTron123 Enthusiast

                    Hi

                     

                    We´ve had the same problem but we have "solved" it. It is related to 2 services, "TP AutoConnect service" and "TP VC GateWay Service"

                    These maps local printers (connected from usb) on a laptop/ordinary client. These services remaps the default printer to the local printer, and if no local printer exists it remaps it to a "vdi local" printer (such as Pdf Writer or similar) and in last case it remaps it to a network printer (randomly)

                     

                    Disable those services and your Default Printer will work like 99% of the time.

                     

                    However, your users can´t use locally connected printers from their laptop and have ThinPrint connect the printer to the VDI if these services is disabled.

                     

                    hope it helps

                     

                    it took us forever to find out a solution.

                    1 person found this helpful
                    • 7. Re: Default printer is not remembered in VDI
                      eXPlosionas Novice

                      Actually it solved the problem for two month after disabling those two TP services. But after a while it started to appear again. Print Spooler service just hangs and cannot stop or restart it.

                      • 8. Re: Default printer is not remembered in VDI
                        jbc974 Novice

                        Hi,

                        To solve this issue that vmware seems to ignore, even if it is really annoying, here is the tip we use in our VDI infrastructure.

                         

                        Windows logoff script (Windows local group policies) :

                        reg delete "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices" /f

                        reg export "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" "%APPDATA%\defaultprt.reg" /y

                         

                        Windows logon script :

                        ping localhost -n 30

                        reg delete "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices" /f

                        ping localhost -n 2

                        reg import "%APPDATA%\defaultprt.reg"

                         

                        It has been working for almost 2 years now.

                        Hope it can help those who get this problem.

                         

                        Philippe

                        1 person found this helpful
                        • 9. Re: Default printer is not remembered in VDI
                          Ray_handels Master
                          Community WarriorsvExpert

                          There might just be an easier solution.

                          We found out that ThinPrint (as stated by someone else) tries to set the default printer every time you log into View.

                          There is a registry key that disables this behaviour without doing other stuff that might damage printing.

                           

                          Try to add (it doesn't exist by default) the following key

                          HKLM\Software\ThinPrint\TPAutoConnect\DisableSettingOfDefPrinter=1 (DWORD)

                          • 10. Re: Default printer is not remembered in VDI
                            cH1LL1 Enthusiast

                            Wev gone old school to get around this problem:

                             

                            we are calling a .bat file from a .vbs file on logon so its silent and simply installing the printer as follows:

                            RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "\\print server\printer name"

                             

                             

                            the  """"/y"""" statement is what sets default.

                            • 11. Re: Default printer is not remembered in VDI
                              RLI2013 Novice

                              That is the way to go... Thanx!

                              • 12. Re: Default printer is not remembered in VDI
                                szilagyic Enthusiast

                                You may also want to check out this KB; it contains a step to disable the mapping of the default printer from the Thin Client, to the VM.

                                 

                                Windows 7 desktops with ThinPrint display only the default printer (1032872)

                                • 13. Re: Default printer is not remembered in VDI
                                  apelz Novice

                                  Hey guys,

                                   

                                  I have the same problem on Windows 10 Enterprise 1909 x64 with VMware DEM 9.9.0 with non persistent instant clones. I have already disabled the TP services in the gold image and the default will not remembered. :-(

                                   

                                  Is there another solution?

                                  • 14. Re: Default printer is not remembered in VDI
                                    apelz Novice

                                    Okay I can see that the printers which I had mapped before, appears with a delay. Maybe this is the reason why the default printer is lost.

                                    1 2 Previous Next