Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9321845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:56:36+00:00 2026-06-19T03:56:36+00:00

I have an ASP.Net 4.0 web application running on IIS 7.5, I can get

  • 0

I have an ASP.Net 4.0 web application running on IIS 7.5, I can get the list of installed printers using System.Drawing.Printing.PrinterSettings.InstalledPrinters command and assign each report in the application to any printer listed above!

There might be some Network Connected Printers on the server all set with full privilege to the application’s user account, everything works perfect until the application’s user account logs off the windows, at this point System.Drawing.Printing.PrinterSettings.InstalledPrinters returns only local printers, no Network Connected Printers are listed!

I’ve tried to impersonate the ASP.Net process to the user with access to Network Printers in following ways, yet no success:

  • I configured the application pool Process Model to run as a
    specific user identity.
  • I impersonated the Application’s identity to specific user in
    Web.Config:

    <identity impersonate="true" userName="user" password="pass"/>

  • And finally implemented impersonation in code using advapi32.dll API

In all of the methods above, the WindowsIdentity returns the true username when printing:

System.Security.Principal.WindowsIdentity.GetCurrent().Name

But it looks like that impersonation is not the issue here, the moment the user logs off, all Network Connected Printers are gone!

Does anybody know how to resolve this? Is there any way to access Network Connected Printers even when the user is not logged in?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:56:37+00:00Added an answer on June 19, 2026 at 3:56 am

    Network Connected Printers, Shared Folders and Map Drives are only accessible when user logs into the OS, they are barely a shortcut to some network resources, all disconnected and are inaccessible when the corresponding user logs off!

    Using System.Printing.PrintServer and the GetPrintQueues method, you can get the collection of print queues that the print server hosts:

    PrintServerUNCName is the UNC name of the corresponding server, as in \\MyServerName

    var printers = new PrintServer("PrintServerUNCName").GetPrintQueues()
        .Where(t =>
        {
            try { return t.IsShared && !t.IsNotAvailable; }
            catch { return false; }
        })
        .Select(t => t.FullName)
        .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Asp.Net web application running on Windows 2008 R2 (IIS 7.5). I
We have an ASP.Net Web Application that is running in an IIS Web-Garden--which is
I have an ASP.Net web application running on an IIS server, and I need
I have an Asp.Net MVC 2 web application deployed on IIS 7.5 on .Net
I have a ASP.NET 1.1 application running on IIS 6 / Windows Server 2003.
I have an ASP.NET Web Application project that I am using to host a
I'm getting the following error in my ASP.NET web application in IIS when running
I have a scenario wherein my ASP.NET MVC 3 web application hosted in IIS
I have a web application using Kerberos to access an external resource useing ASP.NET
I have deployed an ASP.NET web application to Azure running in a web role.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.