locked
How can I enable a disabled service? RRS feed

  • Question

  • I want to test enabling a disabled service through a command line and not through a GPO.  Problem is that everything that I search for shows how to enable that through GPO.  Can anyone assist?
    Friday, December 4, 2009 10:43 PM

Answers

  • Just use the following command line

    sc config servicename start= auto

    Note the space behind the = sign which is required.
    "Everyone is an expert at something" Kim Oppalfens Configmgr expert for lack of any other expertise. http://www.scug.be/blogs/sccm
    • Proposed as answer by TorstenMMVP Monday, December 7, 2009 7:49 AM
    • Marked as answer by boydgrossii Monday, December 7, 2009 3:23 PM
    Saturday, December 5, 2009 7:49 AM

All replies

  • I would recommend that you use other technet forums for non SCCM related questions.

    Using the SC command or a VB script can help you An example VB script is below

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name = 'YourServiceNameHere'")

    For Each objService in colServiceList
    objService.ChangeStartMode("Automatic")
    Wscript.Sleep 5000
    errReturnCode = objService.StartService()
    Next

    Reference :http://www.msfn.org/board/lofiversion/index.php/t46610.html
    • Proposed as answer by TorstenMMVP Monday, December 7, 2009 7:49 AM
    Saturday, December 5, 2009 12:28 AM
  • Just use the following command line

    sc config servicename start= auto

    Note the space behind the = sign which is required.
    "Everyone is an expert at something" Kim Oppalfens Configmgr expert for lack of any other expertise. http://www.scug.be/blogs/sccm
    • Proposed as answer by TorstenMMVP Monday, December 7, 2009 7:49 AM
    • Marked as answer by boydgrossii Monday, December 7, 2009 3:23 PM
    Saturday, December 5, 2009 7:49 AM
  • Just use the following command line

    sc config servicename start= auto

    Note the space behind the = sign which is required.
    "Everyone is an expert at something" Kim Oppalfens Configmgr expert for lack of any other expertise. http://www.scug.be/blogs/sccm

    I also was playing with that and used "sc config servicename start= disabled" to redisable it.

    Thank you.  This is going to be huge for our software updates and we were tasked with figuring this out by today.
    Monday, December 7, 2009 3:23 PM