Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ServiceController

ServiceController

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminquestion
6 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blue_Skye
    wrote on last edited by
    #1

    Hi! Why coding ASP.NET pages, i just can get the status of a windows service by using Service Controller? When i try to start or stop a windows service by Service Controller, i receive a message "Access is denied!" :( Is there anyway to coding an ASP.NET page that can start or stop a service? (The service resides in server too). Thanks!

    M 1 Reply Last reply
    0
    • B Blue_Skye

      Hi! Why coding ASP.NET pages, i just can get the status of a windows service by using Service Controller? When i try to start or stop a windows service by Service Controller, i receive a message "Access is denied!" :( Is there anyway to coding an ASP.NET page that can start or stop a service? (The service resides in server too). Thanks!

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, It's because the ASP.NET process identiy does have permission to start/stop the windows services on the machine. You can take a quick look at an old post[^] in the forum.

      B 2 Replies Last reply
      0
      • M minhpc_bk

        Hi there, It's because the ASP.NET process identiy does have permission to start/stop the windows services on the machine. You can take a quick look at an old post[^] in the forum.

        B Offline
        B Offline
        Blue_Skye
        wrote on last edited by
        #3

        Hi! First of all, I want to thanks your help! :) It's really hard! I've tried change the machine.config file in Microsoft.NET Framework v1.0.3705 and v1.1.4322 folder like this and in my web project I enabled impersonate in web.config file like this : but it still "Access denied" :( I don't know what i am missing. Can you help me? Thanks!

        1 Reply Last reply
        0
        • M minhpc_bk

          Hi there, It's because the ASP.NET process identiy does have permission to start/stop the windows services on the machine. You can take a quick look at an old post[^] in the forum.

          B Offline
          B Offline
          Blue_Skye
          wrote on last edited by
          #4

          Och, i don't know why my code can't appear, so i write it again : In machine.config files processModel userName="SYSTEM" password="AutoGenerate" ... / In my project's web.config file identity impersonate="true"/

          M 1 Reply Last reply
          0
          • B Blue_Skye

            Och, i don't know why my code can't appear, so i write it again : In machine.config files processModel userName="SYSTEM" password="AutoGenerate" ... / In my project's web.config file identity impersonate="true"/

            M Offline
            M Offline
            minhpc_bk
            wrote on last edited by
            #5

            It sounds like the impersonated user does not have permission. Basically, when you enable the impersonation by setting the impersonate attribute to true, the impersonated user can be either the IUSR_MACHINENAME if the anonynmous access is enabled or the authenticated token passed from IIS. So you need to make sure the impersonated user has permission to start/stop windows services on the machine. In addition, you can also explicitly specify the impersonated user in the identity entry of the web.config file. For more information, you can see ASP.NET Impersonation [^] Blue_Skye wrote: i don't know why my code can't appear Remember to tick the checkbox "Do not treat..." below the text editor.

            B 1 Reply Last reply
            0
            • M minhpc_bk

              It sounds like the impersonated user does not have permission. Basically, when you enable the impersonation by setting the impersonate attribute to true, the impersonated user can be either the IUSR_MACHINENAME if the anonynmous access is enabled or the authenticated token passed from IIS. So you need to make sure the impersonated user has permission to start/stop windows services on the machine. In addition, you can also explicitly specify the impersonated user in the identity entry of the web.config file. For more information, you can see ASP.NET Impersonation [^] Blue_Skye wrote: i don't know why my code can't appear Remember to tick the checkbox "Do not treat..." below the text editor.

              B Offline
              B Offline
              Blue_Skye
              wrote on last edited by
              #6

              Thanks a lot! I did it! :-D I don't know why if i set in the .NET Framework machine.config file and then in the web.config file i code like this then i try to run the project, i can't :( But if i set in the machine.config, the project works fine! :-D Really don't know why but thanks you, everything's fine now! Thanks again! You don't know how it's important to me :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups