Cannot raw print to RDP redirected printer - c#

So I have to RDP into my dev environment. From there, I've been trying to send a file to a Zebra label printer in RAW print mode. Similar to this post, the printer doesn't seem to receive anything. I'm using the same c# example code as a proof of concept. That leas to this, but this is already disabled in my group policies.
I am guessing I am just out of luck and have to copy to local as development occurs, but I was hoping not to have to do that.

We had the same problem on a Windows 2016 Server.
We solved it by changing the value of "Use Remote Desktop Easy printer driver first" in the Group Policy from "Not configured" to "Disabled".
This key is in the folder "Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Printer Redirection configurations".
I'm not sure if on the Computer or User configuration, or on both.

The redirect driver simply doesn't support it.
You can work around it by sharing the printer from your local an adding it that way. Then you can raw print to it.

Related

IIS; print on shared printer with IUSR-user

I’m trying to print to a shared printer from a IIS Windows 10 server with the IUSR user. So far unsuccessful.
The print job works with every other user, so it must be the authorization. Local printers are no problem.
On the IIS-server PHP starts a little C# application for server side printing an image. The printer is a shared printer on another Windows 10 pc in the (privat) network. There is no domain controller or something like that.
I have tried so far:
Add network service permissions to the IUSR-user:
https://serverfault.com/questions/469944/how-to-add-network-service-to-users-permission-group/469961
Set up the shared printer to a local port:
https://superuser.com/questions/899808/add-network-printer-as-a-local-printer
Switch to other users with other permissions in the c#-print-applikation:
C# How to change user context in app running on system
None of it works. Does anyone have a good idea or workaround?

Printing from a console that is started by a Windows Service [duplicate]

I'm building an ASP.NET application that requires printing using PrintDocument method:
PrintDocument.Print()
Printing works properly in development env with IIS express. when publishing it to an intranet IIS server, printing fails, which I think is caused by permission issue for aspnet working process.
I tried to do the following with no success:
I created an application pool in integrated pipeline mode for an admin local user with load user profile option set to true
I moved the application to the new created application pool
I added <identity impersonate="true" username="username" password="*****"/> in web.config file
An error appeared stating that: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode so I added <validation validateIntegratedModeConfiguration="false"/> to <system.webServer> section.
Any help please?
I think you might be misunderstanding some fundamental concepts here. When you use PrintDocument.Print() you are printing on the server. When you deploy your application in IIS this printing will happen on the server computer that is hosting your application. The reason why you thought your code was working in IIS Express is because you were hosting your application on the same computer as the client browser that was testing it. Also you were running your application under your account which had a printer configured.
You cannot print directly to the client computer from a web application. That would be a big security issue. The best you could do is provide some HTML document using a print media CSS type. Then if the user decides, he might print it in his browser.
If on the other hand you want to print on some printer that is attached to your web server, you will need to configure the Application Pool in IIS to run under an identity that has a printer configured in its profile.
Hopefully I am understanding your question correctly, but I just had some confusion myself with this. Our setup at my work is Windows Server 2008 R2 with IIS 7.
We have a print server as well installed on the same box (not sure if it matters as this is not my area of expert).
Basically, viewing the installed printers using, PrinterSettings.InstalledPrinters I was able to see all the printer names installed on the server.
I attach a debugger to the application process to debug and I can just use the debugger to see this, otherwise you will have to run a loop to print through these. If you run this locally, you will see only the printers installed on your machine. If they are network printers, then the full path will be shown. So determine the path/name the server will recognize the printer as and then set that to the printer name explicitly using the,
PrinterSettings.PrinterName property of the PrintDocument class. This worked for me. Also, my application pool identity is set to NetworkService.
I think the original poster has gotten a lot of flack for their question. If you want to generate .PDFs using GhostScript, for example, you install a printer driver and create a printer for it. You can suppress the Saveas() dialog in many languages by providing one ahead of time. This was feasible in earlier versions of IIS (that may have been less secure), but is harder to do in IIS 8.
I think this issue is caused by IIS inhibiting access to the local printer queue. This is either caused by not being in the NT AUTHORITY\INTERACTIVE group at runtime, or because IIS will put the user, (whomever is running the app pool) in two groups: IIS APPPOOL\, and BUILTIN\IIS_IUSRS.
You can validate all this by looking at the thread permissions using a tool like Sys Internal's Process Explorer.
I have faced same issue and I found the following solution and it worked for me.
1 - Go to printer and setting of system
2 - Select Printer
3 - Go to Printer Properties
4 - Security
5 - Click on Add "IIS AppPool\DefaultAppPool" as object name and click on check name (Default Pool will be your Pool Name)
6 - Give permission Manage This Printer and Manage Document permission.
7 - Restart IIS

What are the purposes of these three connection options for printing the label in ZPL?

I have these three radio button inside the group box named Printer Connection in the windows form:
a. Network
b. Serial
- dropdownlist
c. Web service
User has to choose one of the option from above before printing any labels or clicking the button Print Label. If someone would explain about the purpose of web service and the scenario how it can be utilize to connect to the printer and printing label. Thank you!
It is hard to understand what app you are using but I have to imagine you are using something based off of the Java SDK by Zebra. In this SDK there is a Web Services SDK. It comes with a .war file that gets added to a Tomcat server. Printers have a set of settings which when configured will have the pritners establish a connection to the server with the .war file installed. Once the printer has connected you can use the Java SDK functions to communicated with the printer from that server.
This explanation is probably over simplified, but if you look through the help documentation on the SDK you will probably get a better explanation.

Configure loopback adapter

Tl;dr How do I access my computer's files using loopbacking?
I need to test my code with a network drive without having one installed. For that, I've installed the Microsoft Loopback Adapter. I can now access it under "Network connections".
Under its properties -> configure -> advanced I've set its network address to 192.168.0.123 .
But it doesn't seem to do anything. I can't, for example, enter that address in a browser or windows explorer and see my computer's files.
How can I achieve that? It doesn't have to be by explorer - if I can do it from C# that's fine because that's the goal anyway.
Thanks everyone. It seems it's trivial (once you know what to do...).
Just use the UNC path. No setup required. (I did share the folder through explorer's UI. But it I'm not sure that was needed.)

Print from Windows Service, no dialog, no user interaction

I would like to print from a Windows Service in C# using Visual Studio 2010. So far, I have only been partially successful by using the code found here:
Print html document from Windows Service without print dialog
The current problem I am experiencing is two fold, which I have only discovered by allowing the service to interact with the desktop:
1) When the URL is entered in as the HTML location, it will request credentials for that location (a network shared IIS web server that I DO NOT have the ability to alter in any way, which requests a username and password to access the information).
2) After I enter credentials, the default printer is ALWAYS the XPS printer, no matter what I do to SetDefaultPrinter (two different ways I have found to do this). I have discovered this is because the printer I want to print to is also a network printer, which the Local System account cannot access (apparently). I have not found a way around this problem.
I would like to get around both of these problems by entering the credentials needed programmatically (this is a network share credential set) and then print to a network printer. In other desktop applications I have successfully printed to each of these network printers even though I do not have each one installed.
Attempting to log in using my credentials instead of the Local System account does not solve either problem. I am using Windows XP.
Assuming I get this to work, I will also need to install the service on another server, so if it is necessary to preinstall each printer I will need to know what steps to take to ensure the Local System account has access to them. The server I will install on will likely be a Windows Server 2003 or 2008, but will have the same network access as the development machine.
EDIT: I attempted a solution of having it Log on as other accounts, all of which should have credentials (and, in fact, if those credentials are entered when it is running as Local System with desktop interaction, those credentials are accepted). Each user that this has been attempted with has had the default printer set to the printer I am trying to test print to, but no print occurs. The only time I know for sure it is trying to use the XPS printer is when it is logged on as Local System with desktop interaction.
Don't run the service as Local System. It doesn't have the rights you need to access network resources. Create a user and run the service under that, if you're in a domain, make sure it's a domain user and not a local one. You will need to log on as that user and install the printers you want to use on the computer where your service runs. Also, if the IIS application is using Windows Authentication, see if the account you're running the service under can be granted permission to access the web application.
I had this issue, this trick solved it
Go to services ---> Double click the required service ---> proceed to logon tab
Supply the Log-in credentials from which printer was installed.
See screen shot below.

Categories