Solved

How to get an ASP.NET application to print to a networked printer

Posted on 2014-02-17
7
228 Views
Last Modified: 2014-04-06
One of my developers created a simple application that reads three files, creates files based on the data in the three files read and sends them to various locations. The last thing the application does is run a batch file that moves the originaly files into an archive location and send them to a networked printer. The application for the most part works just fine except for the last line in the batch file when it trys to print the requested file.

It appears that the issue is with permissions on the respective printer. When I add everyone to the printer's security permissions for printing everything works. Unfortunately, for security reasons I cannot leave this in place. It appears that I need to identify an account that is being used by the application to run the batch file and give this account rights to print to the printer in question. When asked the developer indicates that the application is not using a defined username/password to execute. So how do I identify the account in questions?
0
Comment
Question by:dowhatyoudo22
7 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39865766
In IIS on the server running the application you need to determine the identity being used to run the application pool the asp.net application is running in.
By default this will usually be the NETWORKSERVICE account unless the identity has been changed to use a unique identity.
0
 
LVL 23

Expert Comment

by:Michael74
ID: 39865785
It sounds like the site has Windows Authentication turned on. Try disabling Windows Authentication and then using impersonation to access the printer.

These sites give further information

http://support.microsoft.com/kb/837139
http://msdn.microsoft.com/en-us/library/aa292118(v=vs.71).aspx

Michael
0
 

Author Comment

by:dowhatyoudo22
ID: 39868164
Windows Authentication & ASP.NET Impersonation were both enabled. I tried disabling Windows Authentication and left ASP.NET Impersonation enabled with Authenticated user selected. This setup broke the site. I was unable to load the page after this 401 - Unauthorized: Access is denied due to invalid credentials.

The application is using the Defaultapp pool and its configured to use the local system account rather than the NetworService account,,,,
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39868417
If asp.net impersonation is enabled then I would have thought you would just need to allow permissions on the printer for the user using the website, is that already in place?
0
 

Accepted Solution

by:
dowhatyoudo22 earned 0 total points
ID: 39887107
Yeah the permissions are already in place for the user account. For now we just created a shortcut that points to the batch file on the server. The user is able to manually run the batch file after running the application and it all works as intended.....
0
 
LVL 38

Expert Comment

by:hdhondt
ID: 39981005
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question