Solved

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

Posted on 2014-02-17
7
230 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

726 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