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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:45:29+00:00 2026-06-08T20:45:29+00:00

I’m working on a system where various Windows services run on different computers in

  • 0

I’m working on a system where various Windows services run on different computers in a private network. Any of the computers in the network can run client applications that interact with these services remotely. As part of our package, we have functionality that lets users see whether any of the services in the network are experiencing problems and restart any of them that are downed.

To get this to work, we used user impersonation and the Service Controller class: we ask users to provide the user name and password of an administrative account on the computer hosting the downed service, impersonate that administrator, and then restart the service with ServiceController. This works in most situations, but we can’t impersonate the administrators on some of our servers. My understanding is that for user impersonation to work, the accounts being impersonated have to be on the local machine or part of an Active Directory group, but the servers in question only have accounts that are local to themselves.

I noticed that there are lots of parameters for the LogonUser method that starts impersonation and started playing with them to see if any of them would fix my problem. When I tried setting the LogonType value to “New Credentials” (9), I saw some strange (but potentially useful) behavior:

  • I can restart services on the servers that I couldn’t work with previously
  • If I attempt to restart a downed service and provide an incorrect password, the service is still restarted.

Why am I seeing this behavior? If the reasons for this are good, I might use this set-up to completely get rid of asking users to log in altogether.

  • 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-08T20:45:31+00:00Added an answer on June 8, 2026 at 8:45 pm

    I figured out what’s going on:

    According to Getting the Current username when impersonated, when using impersonation with the logon type of new credentials, the impersonated thread continues to act as the original user for all commands sent to the local computer. It only acts as the impersonated user when it sends commands to other computers.

    This is why I observed that I didn’t need to provide a correct password: If I have a downed user on a server, and then I run a client app as an administrator on that server and try to restart it, then it doesn’t matter what credentials I supply. The impersonated thread will continue to use the administrator account since restarting the service only involves interacting with the local computer. The new credentials I put in are effectively ignored.

    By the way, this means that I should only be able to put in the wrong username and password when I try to restart a service on the local computer. When I tested this some more, that’s what I observed.

    That’s why it looked like I didn’t need to worry about which password I put in. How about how I accessed computers that didn’t have accounts in an Active Directory group? According to this article, “NewCredentials LogonType […] authenticates cross domain.” I’m not exactly sure what happens, but it looks like new credentials doesn’t try to authenticate against Active Directory at all. My guess is that it sends the impersonated credentials straight to the computer being accessed, allowing the impersonation of local accounts.

    For the project I was working on, this means that I still have to ask users for credentials when they try to restart services, but now they can restart services on any server, even if it’s not configured to have an Active Directory account.

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

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Does anyone know how can I replace this 2 symbol below from the string
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
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.