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 6756575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:32:27+00:00 2026-05-26T13:32:27+00:00

I’m querying printers via csharp/.net inside a WCF service. When called locally (i.e. a

  • 0

I’m querying printers via csharp/.net inside a WCF service. When called locally (i.e. a client run from the local machine) It returns one set of printers. When called remotely, it calls a different set.

The wcf service is setup to accept and impersonate using the credentials passed in the creation of the client.

The major difference I’ve notice via remote debugging is the Authentication Type in the call to:

WindowsIdentity.GetCurrent()

Which is Kerberos when called remotely and Neogotiate when called locally.

Here is a quick sampling of code:

[OperationBehavior(Impersonation = ImpersonationOption.Required)]
    public List<string> GetAvailablePrinters()
    {
        List<string> retval = new List<string>();

        using (ManagementClass printerClass = new ManagementClass("win32_printer"))
        {
            ManagementObjectCollection printers = printerClass.GetInstances();
            foreach (ManagementObject printer in printers)
            {
                if ((bool)printer["Shared"] == true)
                    retval.Add((string)printer["Name"]);
            }
        }

        return retval;
    }

Both calls are succeeding, however I get the correct list locally, and nothing remotely.

Here is a side by side of the two:

Test Executable run on the local server:

{System.Security.Principal.WindowsIdentity}
AuthenticationType: "Negotiate"
Groups: {System.Security.Principal.IdentityReferenceCollection}
ImpersonationLevel: Impersonation
IsAnonymous: false
IsAuthenticated: true
IsGuest: false
IsSystem: false
m_authType: null
m_groups: {System.Security.Principal.IdentityReferenceCollection}
m_impersonationLevel: Impersonation
m_isAuthenticated: 1
m_name: null
m_owner: null
m_safeTokenHandle: {Microsoft.Win32.SafeHandles.SafeTokenHandle}
m_user: {xxxxx}
Name: "adomain\\auser"
Owner: {xxxxx}
Token: token number
TokenHandle: {Microsoft.Win32.SafeHandles.SafeTokenHandle}
User: {xxxxxxxx}

Same executable run remotely

{System.Security.Principal.WindowsIdentity}
AuthenticationType: "Kerberos"
Groups: {System.Security.Principal.IdentityReferenceCollection}
ImpersonationLevel: Impersonation
IsAnonymous: false
IsAuthenticated: true
IsGuest: false
IsSystem: false
m_authType: null
m_groups: {System.Security.Principal.IdentityReferenceCollection}
m_impersonationLevel: Impersonation
m_isAuthenticated: 1
m_name: null
m_owner: null
m_safeTokenHandle: {Microsoft.Win32.SafeHandles.SafeTokenHandle}
m_user: {xxxxx}
Name: "adomain\\auser"
Owner: {differnt owner}
Token: different Token number
TokenHandle: {Microsoft.Win32.SafeHandles.SafeTokenHandle}
User: {xxxxxx}
  • 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-05-26T13:32:28+00:00Added an answer on May 26, 2026 at 1:32 pm

    It seems that the printers you are trying to list are remote printers to the machine running the WCF service. Impersonation only lets you access local resources available on the machine being called. This good MSDN article on impersonation and delegation in WCF should get you going on the right track. You’ll either need to implement delegation to list remote resources from the WCF service or not use delegation at all and make the WCF service run under a domain account that can list the remote printers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.