Ir al contenido principal
Para darle permisos a un servicio hay que utilizar la siguiente guía, que ha sido tomada de los siguientes links:

http://serverfault.com/questions/187302/how-do-i-grant-start-stop-restart-permissions-on-a-service-to-an-arbitrary-user
http://msmvps.com/blogs/alunj/archive/2006/02/13/83472.aspx

There doesn't appear to be a GUI-based way of doing this unless you're joined to a domain - at least not one I could find anywhere - so I did a bit more digging and I've found an answer that works for our sitaution.
I didn't understand what the string representation meant in the knowledge base article, but doing a bit of digging led me to discover that it's SDDL syntax. Further digging led me to this article by Alun Jones which explains how to get the security descriptor for a service and what each bit means.
To append to the service's existing security descriptor, use sc sdshow "Service Name" to get the existing descriptor. If this is a plain old .NET Windows Service - as is the case with ours - the security descriptor should look something like this:
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOC
RRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CR;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)S:(AU;FA
;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
We needed to grant permissions RP (to start the service), WP (to stop the service), DT (to pause/continue the service) and LO (to query te service's current status). This could be done by adding our service account to the Power Users group, but I only want to grant individual access to the account under which the maintenance service runs.
Using runas to open a command prompt under the service account, I ran whoami /all which gave me the SID of the service account, and then constructed the additional SDDL below:
(A;;RPWPDTLO;;;S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxx)
This then gets added to the D: section of the SDDL string above:
D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOC
RRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CR;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)(A;;RPWP
DTLO;;;S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxx)S:(AU;FA;CCDCLCSWRPWPDTLOC
RSDRCWDWO;;;WD)
This is then applied to the service using the sc sdset command:
sc sdset "Service Name" D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;
CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CR;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU
)(A;;RPWPDTLO;;;S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx-xxxx)S:(AU;FA;CCDCLCSW
RPWPDTLOCRSDRCWDWO;;;WD)

Entradas más populares de este blog

Crear servidor Ansible

Servidor Ansible Comenzamos instalando un sistema operativo CentOS 7 minimal, podemos hacerlo sobre una maquina virtual Hyper-V, Vmware o en la nube. En Centos 7 instalación mínima por defecto no se tiene conexión a la red dado que las interfaces ethernet no vienen habilitadas de forma predeterminada. Ejecutar comando " nmcli d " para un listado rápido de las interfaces de red instaladas en el equipo. Ejecutar el comando " nmtui " para abrir el Network manager Editar las interfaces y configurar en automático IPv4 y marcar la opción "Conectar de forma automática"  para obtener dirección IP desde un servidor DHCP. Ejecutar " Service Network Restart " Instalar el repositorio EPEL para Centos 7 Ejecutar " yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm " Instalar ansible Ejecutar " yum install ansible " Ejecutar " yum install python-pip " Ejecutar " pip inst...

Solución de Problemas en la Migración del DataCollector de MMA a Azure ARC

  Síntomas Observados Error al Ejecutar Comandos: Al intentar ejecutar los comandos: Import-Module "C:\ODA\Binaries\bin\Microsoft.PowerShell.Oms.Assessments\Microsoft.PowerShell.Oms.Assessments" .\run.cmd Se obtiene el mensaje de error: "ExecPkg not found. File WindowsServerAssessment.execpkg". Ubicación Incorrecta del Archivo WindowsServerAssessment.execpkg: El archivo necesario se encuentra en una ubicación diferente a la esperada: C:\Packages\Plugins\Microsoft.ServicesHub.WindowsServerAssessment\1.7\bin Falta de Estructura de Carpeta Esperada: La carpeta esperada,  C:\ODA\Packages , no existe en el sistema. Errores Registrados en los Logs: En los registros (logs) del sistema se reporta el error: "Missing Mandatory file OmsAssessment.exe". Pasos para Solucionar los Problemas 1. Desinstalación del Microsoft Monitoring Agent (MMA) y Eliminación de Variables de Entorno Desinstala completamente el MMA asegurándote de eliminar todo el software relacionado. Ve...

Utilizar Ansible para implementar sobre Azure

Bien, ya tenemos nuestro servidor Ansible on-premises o en la nube. Ahora vamos a comenzar a usarlo para desplegar algo en Azure. Credenciales Lo primero que debemos hacer es crear las credenciales para poder  comunicar Ansible con nuestra subscripcion de Azure. Para eso vamos a usar la opción application registration del modulo de Active Directory de Azure. o mucho mas fácil ejecutando el siguiente comando desde la interfaz de comandos web de Azure.' az ad sp create-for-rbac --query '{"client_id": appId, "secret": password, "tenant": tenant}' La salida se vera parecida a lo siguiente: {   "client_id": "eexx6xxa-9xx8-4xx6-8xx7-0xx3xx5xx0d5",   "secret": "53xxcxxa-3xxf-4xx8-9xxb-48xxcxx5xx3f",   "tenant": "72xx8xxf-8xx1-4xxf-9xxb-2dxxd0xxdb47" } lo anotamos y luego vamos por la identificación de la subscripcion con el siguiente comando: az account show --query "{ ...