print to network printer using ASP.NET on IIS6 (2003 Server)

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default print to network printer using ASP.NET on IIS6 (2003 Server)

    Is there any security reason why you cannot print to a network printer from
    ASP.NET under IIS6 on Windows 2003 server?

    I'm using ASP.NET code to print to a server print queue using
    PrintDocument.Print()
    (.NET framework v 1.1)
    I can print to a local printer plugged into LPT1 on the web server, but not
    to a network printer.

    The same printing code to a network printer works in a .NET web app when
    hosted on Windows XP pro, or Windows 2000 Server, but NOT on Windows 2003
    server.
    The same printing code to a network printer also works in a .NET Windows app
    on Windows 2003 server, when logged in to Windows as the same user that the
    web app is impersonating (DOMAIN\webaccount), so we know this account has
    sufficient permission to print to the netowrk printer.

    Web app configuration details:
    Web.config has <authentication mode="windows"/> <identity
    impersonate="true">
    Web Application is running in a virtual directory on the Default Web Site
    Virtual directory Security: anonymous access is enabled, & set to use the
    specific Windows domain account DOMAIN\webaccount. All the other
    authenticated access methods are disabled/unchecked
    Application pool: our Web Application is using a specific application pool
    that uses DOMAIN\webaccount as its identity.
    IIS 6 is not running in IIS 5 isolation mode.

    The errror from PrintDocument.Print() is
    System.Drawing.Printing.InvalidPrinterException: Tried to access printer
    '\\REMOTEMACHINE\PrinterName' with invalid settings.

    Full stack trace when call PrintDocument.Print:
    System.Drawing.Printing.InvalidPrinterException: Tried to access printer
    '\\REMOTEMACHINE\PrinterName' with invalid settings. 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.Windows.Forms.PrintControllerWithStatusDial og.OnStartPrint(PrintDocum
    ent document, PrintEventArgs e) at
    System.Drawing.Printing.PrintController.Print(Prin tDocument document) at
    System.Drawing.Printing.PrintDocument.Print() at
    PrintingGDI.WebForm1.Button1_Click(Object sender, EventArgs e)

    What could be preventing ASP.NET from printing to a network printer?

    Thanks for any ideas,

    Tessa


    Tessa Guest

  2. Similar Questions and Discussions

    1. Installing CF 5.0 server on Windows 2003 with IIS6
      Hello, Can anyone tell me if it is ok to install CF 5.0 server on win2003 server using iis 6? thank you Sanjay
    2. CF7 / IIS6 / Win 2003 Server Install Problem
      Hi, any help would be very much appreciated as MACROMEDIA have provided no useful help. One would think they would have a decent level of...
    3. Error ASP 0178 on Windows 2003 Server (IIS6) by Server.CreateObject on DCOM registred Component
      Heres is a workaround, 1. go to Administrative Tools> Component Services 2. expand COM Services and right click on My computer. 3. click...
    4. Illustrator will not print to network printer
      We have a ricoh 6300 printer, and Illustrator, version 10.0 stopped printing to this on printer. All other programs will print to it, and Illustrator...
    5. WINXP CLIENT CANT PRINT TO NETWORK PRINTER
      When I install the network printer on a winxp home client, it seems to work ok. Then when the client is restarted the winxp home client can't print...
  3. #2

    Default Re: print to network printer using ASP.NET on IIS6 (2003 Server)

    I am having the same problem. Did you ever figure out what was the problem?

    Thanks,
    Jorge
    > Is there any security reason why you cannot print to a network printer from
    > ASP.NET under IIS6 on Windows 2003 server?
    >
    > I'm using ASP.NET code to print to a server print queue using
    > PrintDocument.Print()
    > (.NET framework v 1.1)
    > I can print to a local printer plugged into LPT1 on the web server, but not
    > to a network printer.
    >
    > The same printing code to a network printer works in a .NET web app when
    > hosted on Windows XP pro, or Windows 2000 Server, but NOT on Windows 2003
    > server.
    > The same printing code to a network printer also works in a .NET Windows app
    > on Windows 2003 server, when logged in to Windows as the same user that the
    > web app is impersonating (DOMAIN\webaccount), so we know this account has
    > sufficient permission to print to the netowrk printer.
    >
    > Web app configuration details:
    > Web.config has <authentication mode="windows"/> <identity
    > impersonate="true">
    > Web Application is running in a virtual directory on the Default Web Site
    > Virtual directory Security: anonymous access is enabled, & set to use the
    > specific Windows domain account DOMAIN\webaccount. All the other
    > authenticated access methods are disabled/unchecked
    > Application pool: our Web Application is using a specific application pool
    > that uses DOMAIN\webaccount as its identity.
    > IIS 6 is not running in IIS 5 isolation mode.
    >
    > The errror from PrintDocument.Print() is
    > System.Drawing.Printing.InvalidPrinterException: Tried to access printer
    > '\\REMOTEMACHINE\PrinterName' with invalid settings.
    >
    > Full stack trace when call PrintDocument.Print:
    > System.Drawing.Printing.InvalidPrinterException: Tried to access printer
    > '\\REMOTEMACHINE\PrinterName' with invalid settings. 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.Windows.Forms.PrintControllerWithStatusDial og.OnStartPrint(PrintDocum
    > ent document, PrintEventArgs e) at
    > System.Drawing.Printing.PrintController.Print(Prin tDocument document) at
    > System.Drawing.Printing.PrintDocument.Print() at
    > PrintingGDI.WebForm1.Button1_Click(Object sender, EventArgs e)
    >
    > What could be preventing ASP.NET from printing to a network printer?
    >
    > Thanks for any ideas,
    >
    > Tessa
    >
    >
    User submitted from AEWNET ([url]http://www.aewnet.com/[/url])
    Guest Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139