Solved

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

Posted on 2014-02-17
7
225 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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:Herman D'Hondt
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now