none
Printer Redirection server 2016 RRS feed

  • Question

  • Hello,

    Here's the thing.

    I'm running Windows server 2016. I have three users which concted via RDP. The local printers redirect fine, but...

    When I try to print from a specific application, it not print to default redirected printer, but to another one which is default for server, not for client machine.

    In registry there is

    1.HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device - Print to PDF

    and

    2.HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\SessionDefaultDevices\S-1-5-5-0-3868501870 - The name of default client redirected printer.

    So the application try to print to printer from point 1, not to printer from point 2.

    How can I set the printer from point 1 to get the name of printer from point 2?

    The printer from point 2 has different name each time I log on to server. So I can't set it manually.

    Thanks

    Thursday, October 19, 2017 1:51 PM

All replies

  • Hi,

    I assume that the behavior is application specific, if that's the case I would suggest consult with the application vendor support to see whether there is a way to change the default printer from system to current user's.

    Best Regards,

    Amy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, October 20, 2017 10:17 AM
    Moderator
  • I think this not. In Windows server 2012 there was no such problem.

    In this registry

    1.HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device -

    there was the redirected printer.

    Obviously there is some changes in server 2016 that  works in different way.

    I see the redirected printer in control panel\devices and printers as default.

    What is the reason server 2016 not to set 1.HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device - redirected printer

    Best regards

    Friday, October 20, 2017 10:32 AM
  • Hello,

    Somebody some ideas!

    Monday, November 6, 2017 6:49 AM
  • If this is specific to a certain application, it might be caused by the printer name changing each time the user logs in. Try this script to rename the redirected printers to something consistent. https://github.com/zniezelski/Printerceptor/releases

    Friday, November 17, 2017 12:12 PM
  • I have the same problem

    did you found solution

    Wednesday, May 23, 2018 8:19 PM
  • I have the same problem

    did you found solution

    Wednesday, May 23, 2018 8:22 PM
  • Hi,

    I assume that the behavior is application specific, if that's the case I would suggest consult with the application vendor support to see whether there is a way to change the default printer from system to current user's.

    Best Regards,

    Amy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Hello Amy, it looks like a bug which is yet to be noticed and resolved by Microsoft. I've the May 2018 cumulative update and the issue persists. This is forcing us to rollback to Windows 2012 R2 for a legacy application that is referring to the "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows:Device" key value rather than sessiondefault device!

    I would love to consider this as a BUG BUG BUG than a modern approach as many of the legacy applications those are published using Citrix like are not anymore supported or there won't be any possibilities of including the latest APIs!

    Wednesday, May 30, 2018 9:35 AM
  • Agreed. Yes. This is a bug in Windows Server 2016. One of our older apps that uses the Crystal Report 8.5 runtime wasn't working properly when running on a Windows Server 2016 RDP server. The app crashed every time we tried to print something from one of the built-in reports. In troubleshooting this issue we discovered that the default printer has always been stored in the registry key "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device". This has been the location of the default printer in the registry in absolutely forever and this registry key is set correctly in Windows Server 2008 R2 and Server 2012 R2.

    We found that this registry setting isn't being set if the default printer is an auto-created session printer. However, if we select any of the locally attached printers on the server such as the "Microsoft Print to PDF" or "Microsoft XPS Document Writer" the registry key does get set properly. Once this registry key is created and set properly the Crystal Report 8.5 runtime works perfectly and the app prints just fine.

    The inconsistent behavior of Server 2016 shows that this is definitely a bug. 

    To temporarily resolve this issue we've written a Powershell script to sets this registry key based on the current default printer when the user signs on and we launch the Powershell script as part of the app's startup.

    # Clear any existing errors.
    #
    "Waiting for printers to be created"
    
    #Start-Sleep 5
    
    $error.clear()
    $registrykey = "Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows"
    
    # Set the location
    #
    Set-Location -Path $registrykey -ErrorAction SilentlyContinue
    
    # Retrieve the default printer properties.
    #
    $wmiDefaultPrinter = Get-WmiObject -query "SELECT * FROM WIN32_PRINTER WHERE Default = TRUE"
    
    # If the default printer exists then set the registry values.
    #
    if ($wmiDefaultPrinter -ne $null)
    {
    	"Setting the Windows default printer registry key"
    	Set-ItemProperty -Path $registrykey -Name "Device" -Value ($wmiDefaultPrinter.Name+",winspool,Ne00:")
    	Write-Host "Your default printer is" $wmiDefaultPrinter.Name
    } else {
    	Set-ItemProperty -Path $registrykey -Name "Device" -Value "Microsoft Print to PDF,winspool,Ne01:"
    }

    
    

    Wendell W. Pinegar


    Friday, June 15, 2018 11:09 PM