I say.

A blog by Joakim Beijar, I solve interesting and mundane problems at HappySignals and hack at night on github.com/kaa.

Error 80041003 when manipulating Services using WMI through ASP

30 Mar 2010

You can run into quite strange errors when attempting to access WMI though ASP, note that there are a few steps to remember for bliss.

  1. Ensure you give permissions for the user in question to access WMI. Computer -> Manage -> Configuration -> WMI Control -> Properties, in the Security tab ensure your user has permissions to the right namespaces (probably Root/CIMV2). The permission required is usually 
  2. Use either SC.exe or preferrably SetACL.exe to set access control lists for the relevant user on the service, for example:
    SetACL.exe -on SERVICE_NAME -ot srv -actn ace -ace "n:USER_OR_GROUP;p:start_stop"
  3. Finally you need to enable impersonation to work, for that we need to pass the password as plaintext. To do this ensure you use Basic authentication instead of Windows Authentication.