We are working on a requirement to submit print requests from a windows server to print server using the LPR/LPD protocol. We are trying to find the ability to specify username on the print request. Because the print requests are submitted by a batch process on the windows server, we need to be able to specify different username for each job than the one that is picked up by default. Essentially, we need to be able to specify a different user name per print job.

Is there a way to achieve this from a windows server? It will be super helpful if you can share any alternate suggestions as well.

The Windows operating system's "lpr" command does not allow you to change the name of the user; the job owner is always the owner of the process that issued the "lpr" command. This is unfortunate, as nearly every other operating system (MacOS, Linux distributions, etc.) do let you do this at the command line by modifying the destination URI (for example: lpr://username@printer:port), so you might want to consider moving your batch process to a different operating system. Alternately, you could likely just build your own "lpr" function and extend its capabilities. An example C# project for Windows can be found at An LPR Client in C# - CodeProject . Good hunting!

Your example related to C# project triggered the idea to find similar projects. I found similar implementation in JAVA that provides the capability to specify username. Below is the link. We did some test runs and it worked for us.