RSS

Printing in IIS using ASP.NET or Web services

24 Jan

You can try as below:

1. Changing the account that ASP.NET runs under.

The IIS Worker Process runs as Network Service and the ASP.NET Worker Process runs as ASPNET by default. So to access the Installed Printers you have to change it to run under Local System Account.

2. You can impersonate the asp.net site

When the IIS Worker Process or the ASP.NET Worker Process starts a Web application, the Web application inherits the identity of the process if impersonation is disabled. (Impersonation is the process of allowing a thread to run under a different account from its process.) However, if impersonation is enabled, each Web application runs under the user account that is authenticated by IIS or the user account that is configured in the Web.config file. Impersonation can be enabled in either of the following two ways in Web.config:

<identity impersonate="true"/>

This allows the Web application to run using the identity that was authenticated by IIS.

<identity impersonate="true"
 userName="SomeUserAccount"
 password="SomePassword"/>

This allows the Web application to run using a specific identity.

If you have the network printer in my printers then it will show up in Installed printers.

Reference links: Stackoverflow.com and Bluevisionsoftware.com

 
5 Comments

Posted by on January 24, 2012 in .NET, ASP.NET, C#, IIS

 

Tags: , , , , , , , , , , ,

5 responses to “Printing in IIS using ASP.NET or Web services

  1. dow jones industrial average

    February 6, 2012 at 2:52 AM

    i love your blog, i have it in my rss reader and always like new things coming up from it.

     
  2. Metal Brackets

    July 10, 2012 at 6:20 PM

    Thank you for publishing this information on your site.

     
  3. Gregory Despain

    August 12, 2012 at 12:32 PM

    So very true….Thanks for blogging this….

     
  4. sherif abdalmageed

    September 6, 2012 at 3:28 PM

    where in web config i write

     
  5. Harsh Baid

    September 6, 2012 at 11:14 PM

     

Leave a Reply