start process as impersonated account for NETSH DHCP?

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default start process as impersonated account for NETSH DHCP?

    Am trying to automatically query and update DHCP servers via a web
    application with VB.NET. Testing with a privileged account, defined
    thus in web.config:

    <identity impersonate="true" userName="<domain>\<user>"
    password="<password>" />

    Have also modified machine.config thusly, and restarted IIS (but
    haven't rebooted):

    <processModel enable="true" ... userName="<domain>\<user>"
    password="<password>" />

    I can run NETSH commands interactively when logged in. Also, in code
    below, I confirm that I am impersonating the user rather than running
    as ASPNET. It still seems that the process is running with limited
    rights of ASPNET; output reads: "Unable to determine the DHCP Server
    version for the Server <ip>.Server may not function properly."

    Dim proc As New System.Diagnostics.Process()
    proc.StartInfo.FileName = "netsh"
    proc.StartInfo.Arguments = "dhcp server <ip> show scope"
    proc.StartInfo.WindowStyle =
    System.Diagnostics.ProcessWindowStyle.Hidden
    proc.StartInfo.UseShellExecute = False
    proc.StartInfo.RedirectStandardOutput = True
    proc.Start()
    TextBox1.Text = proc.StandardOutput.ReadToEnd.ToString & " " &
    System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString
    proc.Close()
    proc.Dispose()

    How can I ensure/confirm that the System.Diagnostic.Process is running
    as the impersonated account, and not the parent? Assistance greatly
    appreciated!
    Monroe Guest

  2. Similar Questions and Discussions

    1. Worker Process Account for ASP.NET
      Hi, I am trying to figure out the default Worker Process Account for ASP.NET Worker Process. Following is my list - IIS 5.0 on Windows 2000 ...
    2. Start external Process under different user account in ASP.NET???
      Does anyone know how to get Process.Start() to use the security context of the user that my ASP.NET app is impersonating? It seems that it is...
    3. ASPNet Process Token flowing with Impersonated Identity
      I have a problem with a service-oriented application that is using impersonation. MachineA (Web Server) - Hosts webservices MachineB (App...
    4. Process.Start in a web service
      When an ASP.NET app calls Process.Start(), is the resulting process run under the same user as the ASP.NET app? My situation is an ASP.NET app...
    5. Start external process from ASP.Net
      Hello: I am currently having problems with an ASP.NET page...I've never programmed in ASP or HTML so all of this is new to me. I have a table that...
  3. #2

    Default Re: start process as impersonated account for NETSH DHCP?

    Processes created by the Process class will be started with current process
    token's account, not the impersonated account. The thing I don't understand
    is why your ASP.NET worker process is still running as ASPNET as that change
    should have allowed you to accomplish your goal. Is it possible that there
    are multiple versions of the framework installed and you changed the wrong
    config file? Is this IIS 6, 5.1 or 5? 6 doesn't use the processModel
    section but is configured via the MMC in the AppPool settings.

    Another good option I've seen for starting a process as a specific user is
    to use WMI to accomplish this, but I haven't been able to find the code
    sample that was posted here that shows how.

    HTH,

    Joe K.

    "Monroe" <monroe.golden@bellsouth.com> wrote in message
    news:722dd0b8.0411231227.48fba9ae@posting.google.c om...
    > Am trying to automatically query and update DHCP servers via a web
    > application with VB.NET. Testing with a privileged account, defined
    > thus in web.config:
    >
    > <identity impersonate="true" userName="<domain>\<user>"
    > password="<password>" />
    >
    > Have also modified machine.config thusly, and restarted IIS (but
    > haven't rebooted):
    >
    > <processModel enable="true" ... userName="<domain>\<user>"
    > password="<password>" />
    >
    > I can run NETSH commands interactively when logged in. Also, in code
    > below, I confirm that I am impersonating the user rather than running
    > as ASPNET. It still seems that the process is running with limited
    > rights of ASPNET; output reads: "Unable to determine the DHCP Server
    > version for the Server <ip>.Server may not function properly."
    >
    > Dim proc As New System.Diagnostics.Process()
    > proc.StartInfo.FileName = "netsh"
    > proc.StartInfo.Arguments = "dhcp server <ip> show scope"
    > proc.StartInfo.WindowStyle =
    > System.Diagnostics.ProcessWindowStyle.Hidden
    > proc.StartInfo.UseShellExecute = False
    > proc.StartInfo.RedirectStandardOutput = True
    > proc.Start()
    > TextBox1.Text = proc.StandardOutput.ReadToEnd.ToString & " " &
    > System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString
    > proc.Close()
    > proc.Dispose()
    >
    > How can I ensure/confirm that the System.Diagnostic.Process is running
    > as the impersonated account, and not the parent? Assistance greatly
    > appreciated!

    Joe Kaplan \(MVP - ADSI\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139