Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Windows Service wont start on older PC

Options
  • 15-12-2011 4:16pm
    #1
    Registered Users Posts: 4,012 ✭✭✭


    I have created a Windows service in C# that I am using on Windows XP.
    When I install it on a newish DELL (two years old) and log on as a domain user, I can start the service fine but when I install the exact same service on an older DELL (2005) it gives me "access denied" when I try to start it.
    This is depite the fact on Windows XP domain users can stop and start a Windows services.
    I am thinking it is to do with the PC because they both have Windpws XP Service pack 3 and both have .NET Framework 2.0.
    Has anyone comee across this problem before? I would have though the age of a PC would have nothing to do with ability to stop and start services.


Comments

  • Closed Accounts Posts: 162 ✭✭totoal


    lukin wrote: »
    I have created a Windows service in C# that I am using on Windows XP.
    When I install it on a newish DELL (two years old) and log on as a domain user, I can start the service fine but when I install the exact same service on an older DELL (2005) it gives me "access denied" when I try to start it.
    This is depite the fact on Windows XP domain users can stop and start a Windows services.
    I am thinking it is to do with the PC because they both have Windpws XP Service pack 3 and both have .NET Framework 2.0.
    Has anyone comee across this problem before? I would have though the age of a PC would have nothing to do with ability to stop and start services.
    Can an Administrator start/stop service?
    Would it be a missing dependency?
    Anything in System Event Log?


  • Closed Accounts Posts: 577 ✭✭✭Galtee


    Don't know the full ins and outs but one thing to look out for when writing services is access rights. To the best of my recollection, services run in the conext of the system account and don't have access to network pipes and shares by default. You may need to log the service on as a particular user account on the machine and go through the usual rights checking on the user to make sure you have access to everything you need.


  • Registered Users Posts: 4,012 ✭✭✭lukin


    totoal wrote: »
    Can an Administrator start/stop service?
    Would it be a missing dependency?
    Anything in System Event Log?

    Yes the administrator can start the service. Dont think it is a missing dependency on client side. I haven't checked the system log but I will.


  • Registered Users Posts: 2,426 ✭✭✭ressem


    This is depite the fact on Windows XP domain users can stop and start a Windows services.

    Lukin, that's not correct. Specific services may have been configured by default during install or through group policy to allow a user to start and stop them.

    Been through this before.

    http://www.boards.ie/vbulletin/showthread.php?t=2056122566&page=2

    or if you want to read it from someone else...
    http://www.windowsitpro.com/article/permissions/q-how-can-i-control-how-to-stop-or-start-certain-services-


  • Registered Users Posts: 2,781 ✭✭✭amen


    you could also look at sysinternals. They have a tool that monitors the system and tells what dlls/exes are access by a process and from there you should be able to figure out missing privelleges


  • Advertisement
  • Registered Users Posts: 2,426 ✭✭✭ressem


    amen wrote: »
    you could also look at sysinternals. They have a tool that monitors the system and tells what dlls/exes are access by a process and from there you should be able to figure out missing privelleges

    That's correct, but the process may not be getting that far.
    If OP uses
    sc.exe sdshow servicename
    it'll return a string like
    D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
    
    which can be decyphered using the key

    http://support.microsoft.com/kb/914392

    ;;;SY is local system
    ;;;BA is local admins
    ;;;IU is interactive login user
    ;;;SU is a service login user

    the RPWP in the middle of the strings indicates start and stop permission.

    to get the behaviour the OP wants, there would have to be a
    (A;;CCLCSWRPWPDTLO;;;DU) or ;;;BU
    or similar entry added.

    I'd suspect that the domain user is configured as a local admin on the newer machine.


  • Registered Users Posts: 4,012 ✭✭✭lukin


    ressem wrote: »
    Lukin, that's not correct. Specific services may have been configured by default during install or through group policy to allow a user to start and stop them.

    Been through this before.

    http://www.boards.ie/vbulletin/showthread.php?t=2056122566&page=2

    or if you want to read it from someone else...
    http://www.windowsitpro.com/article/permissions/q-how-can-i-control-how-to-stop-or-start-certain-services-

    I know that but when I had the original problem from that thread it was only on Windows 7 I couldn't start the service. I never had a problem starting the service in XP under a domain account. I have the exact same service iinstalled on another PC (under Win XP) and I have no problem starting it under the same domain account.
    It is just on these PCs, same service, same OS, same .NET Framework (2.0).


  • Registered Users Posts: 4,012 ✭✭✭lukin


    OK I found out what it is:
    On the PC that the service IS starting on (as a domain user) that domain user is listed under User
    Accounts on the local PC (as a Power User). This means this user can start the service.
    If I delete this user from User Accounts on the local PC, then log on to that PC (to the domain) as that user, I am unable to start the service.
    If I change the service descriptor by adding (A;;CCLCSWRPWPDTLOCRRC;;;WD) (WD means Everyone can start the service) then that user can log on to the domain and start the service (even though that user is not in User Accounts on the local PC).
    The weird thing is that this is not the case on Windows 7 (a domain user does not have to be listed under User Accounts on the local PC to start the service)


Advertisement