Solved

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

Posted on 2014-02-17
7
226 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

867 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

16 Experts available now in Live!

Get 1:1 Help Now