?
Solved

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

Posted on 2014-02-17
7
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Michael Fowler
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

762 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