Accessing the current logon information for a windows service

From: Reddog (reddogaw_at_hotmail.com)
Date: 02/27/04

  • Next message: Siew Moi Khor [MS]: "Re: Word 2003: Smart tags and .NET security and trust all installed addins and templates"
    Date: 26 Feb 2004 22:08:53 -0800
    
    

    I want to be able to query the current logon details for a windows
    service. That is, i want to get a handle (or even the
    username/password) for the account that a service runs under. How can
    this be done?

    The reason for this is that we have our application running as a
    service. We also have another exe for the settings and configuration
    of our service (including start, stop, pause, etc). We also have a
    number of diagnostic functions that can be run from the interface and
    a number of these require permissions to the server. So we want the UI
    to impersonate the user the service is running under. I have the
    impersonation functionality but not the ability to get the user handle
    it needs to impersonate.

    We also already have the functionality to change the credentials of
    the service (using interop).

    All help appreciated.

    Andrew.
    www.ssw.com.au


  • Next message: Siew Moi Khor [MS]: "Re: Word 2003: Smart tags and .NET security and trust all installed addins and templates"

    Relevant Pages

    • Re: Best way to provide security when need a WindowsIdentity
      ... For them to use the sharepoint functionality we need to impersonate a ... This sets the request context to the correct windows user, ... throw away the username/password, and use that principal from then on ... database queries is done under the WindowsIdentity of the user. ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Difference between .NET and Java
      ... > people that I know agree with my speculation that the CLR was in fact ... > similarities between the CLR and the Win32 API. ... Actually what I ment to say was the .NET has Windows specific functionality ...
      (comp.lang.java.programmer)
    • Save File to Server on Different Domain
      ... The file server is on a different domain than the web server. ... Sometimes you might need to obtain a Windows NT account token to impersonate ... Imports System.Collections ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Save File to Different Domain - 2nd Post
      ... Sometimes you might need to obtain a Windows NT account token to impersonate ... Imports System.Collections ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Save File to Different Domain - 2nd Post
      ... maybe the user doesn't have logon permissions on the server ... > impersonate a user with the proper permissions on the file server: ... > Sometimes you might need to obtain a Windows NT account token to ... > Imports System.Collections ...
      (microsoft.public.dotnet.framework.aspnet.security)