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. General Programming
  3. .NET (Core and Framework)
  4. Installing Windows Service

Installing Windows Service

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpsysadminhelpquestion
5 Posts 3 Posters 0 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.
  • H Offline
    H Offline
    Hercules01
    wrote on last edited by
    #1

    Hi, i'm writing a windows service nad it wroked very well in C#, the problem is that it runs unser the LocalSystem acount and i want to run it under a specific User acount in the network, but whenever i chose this option the Service is failed to be installed, i use the "installutil.exe" that comes with the .NET and when i ask to install the service it shows a login dialog that asks for the username and password, and i enter a valid user name and password in the domain ( which is my account!!!) but still it keep fails to install and it rollback! does anyone have a solution for this problem?

    A 1 Reply Last reply
    0
    • H Hercules01

      Hi, i'm writing a windows service nad it wroked very well in C#, the problem is that it runs unser the LocalSystem acount and i want to run it under a specific User acount in the network, but whenever i chose this option the Service is failed to be installed, i use the "installutil.exe" that comes with the .NET and when i ask to install the service it shows a login dialog that asks for the username and password, and i enter a valid user name and password in the domain ( which is my account!!!) but still it keep fails to install and it rollback! does anyone have a solution for this problem?

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Did you set the account you want your service to use, "log on as service" rights. If not, you'll need to do this manually in the "Local Security Policy" MMC Console.

      H 2 Replies Last reply
      0
      • A Anonymous

        Did you set the account you want your service to use, "log on as service" rights. If not, you'll need to do this manually in the "Local Security Policy" MMC Console.

        H Offline
        H Offline
        Hercules01
        wrote on last edited by
        #3

        thanks for your help, it wasn't actully the problem but your way helped find it, i was it seems i wasn't writing my user name in the way that should be, Domain\UserName. thx again.

        1 Reply Last reply
        0
        • A Anonymous

          Did you set the account you want your service to use, "log on as service" rights. If not, you'll need to do this manually in the "Local Security Policy" MMC Console.

          H Offline
          H Offline
          Hercules01
          wrote on last edited by
          #4

          can i ask another question, ow if i want to change the user name name and password from the code (since i'm bilding a controller for the service) i can stop and start and query the service but i need to have control on changing the User name and Password, so do you know or any other how can i do it in C#?

          P 1 Reply Last reply
          0
          • H Hercules01

            can i ask another question, ow if i want to change the user name name and password from the code (since i'm bilding a controller for the service) i can stop and start and query the service but i need to have control on changing the User name and Password, so do you know or any other how can i do it in C#?

            P Offline
            P Offline
            progload
            wrote on last edited by
            #5

            There are a few Articles here on CP in the C# section dealing with that, just search "service". Here is an example: http://www.codeproject.com/csharp/CSharpWindowsServiceInst.asp

            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