Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Simple Printing Problem?

Reply
Thread Tools

Simple Printing Problem?

 
 
Brian
Guest
Posts: n/a
 
      02-06-2007
Hi all,

I have an asp.net 2 application that get an image from SQL reporting
services and sends it to the printer. It works fine as a console application
on all computers and as an asp.net application on my windows xp computer.
However when I run it under IIS on a 2003 server it return the error
message:

"Settings to access printer '\\server\printer' are not valid."

I assume this is a security issue related to printing under IIS but am
unsure where to look. The application is configured with impersonation and
windows authentication etc.

Where can I look? What stops a IIS process from accessing network printers
under a windows account? How come it works on Windows XP but not Windows
2003?

Stack trace below but basically it calls PrintDocument.Print.

Thanks,
Brian


 
Reply With Quote
 
 
 
 
Brian
Guest
Posts: n/a
 
      02-06-2007
The stack trace is below. Why does it think that the thread is running under
network service when I checked and it is running under the impersonated user
account? Did the Thread.CurrentPrincipal change somehow?
Brian

Request information:

Request path: /batchprint/Execute.aspx

User host address: 192.168.1.40

User: domain\user

Is authenticated: True

Authentication Type: Negotiate

Thread account name: NT AUTHORITY\NETWORK SERVICE


Thread information:

Thread ID: 8

Thread account name: NT AUTHORITY\NETWORK SERVICE

Is impersonating: False

Stack trace: at
System.Drawing.Printing.PrinterSettings.GetHdevmod eInternal()

at System.Drawing.Printing.PrinterSettings.GetHdevmod e(PageSettings
pageSettings)

at System.Drawing.Printing.PrintController.OnStartPri nt(PrintDocument
document, PrintEventArgs e)

at
System.Drawing.Printing.StandardPrintController.On StartPrint(PrintDocument
document, PrintEventArgs e)

at System.Drawing.Printing.PrintController.Print(Prin tDocument document)

at System.Drawing.Printing.PrintDocument.Print()

at BatchPrintUtility.PrintReport.Print()

at BatchPrintUtility.PrintReport.RenderPrint(String Report, String
Parameters, Int32 Copies)

at Execute.PrintReportBatch(Object printer)

at Execute.Page_Load(Object sender, EventArgs e)


 
Reply With Quote
 
 
 
 
Brian
Guest
Posts: n/a
 
      02-07-2007
Update on the problem:

The asp.net application seems to work fine on any computer when accessed
through http://localhost but when accessed through http://computername the
"PrintDocument.Print" returns the error message.
"Settings to access printer '\\server\printer' are not valid"

What is the difference in security (assuming this is the problem) running
localhost as compared with accessing it through the server?

Brian


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 2 11-27-2010 12:12 PM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:52 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:50 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:28 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-18-2007 10:11 AM



Advertisments