Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Min permission to restart a service on server

  • Filter
  • Time
  • Show
Clear All
new posts

  • Min permission to restart a service on server


    I would like to grant a domain user access to start, stop and restart a service on a remote computer running a batch file. When she runs this file from her PC she get access denied. Does she need to be a power user or an administrator on the server?

    option explicit
    Dim cimv2, oService, Result , strComputer,strServiceName
    strComputer = "192.168.1.*" ' Local Computer
    strServiceName = "sage200" ' sage Service om remote service
    'Get the WMI administration object
    Set cimv2 = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" & _
    strComputer & "\root\cimv2")
    'Get the service object
    Set oService = cimv2.Get("Win32_Service.Name='" & strServiceName & "'")

    'Path = "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & _
    ' "\root\cimv2:Win32_Service.Name='" & strServiceName & "'"
    'Get the WMI administration object of the service
    'Set oService = GetObject(Path)
    'Check base properties
    If oService.Started Then
    ' the service is Not started
    wscript.echo "The service " & strServiceName & " is all ready running."
    ' Start the service
    wscript.echo "Start " & strServiceName & " is Now running:"
    End If

  • #2
    Re: Min permission to restart a service on server

    I suggest add your user to local server operator group. This group has right to shut down computer and since you adding user to local group you are not assiging additional permission.. well ensure assigning domain user to local server operator group will not jeoperdise security of infrastructure