Cannot open Service Control manager by service hosted in IIS with a locl account as user in the app pool

291 Views Asked by At

I have a service hosted in IIS on a windows 2016 standard server that uses System.ServiceProcess.ServiceController.GetServices() to retrieve the running services. When I use a custom app pool with a local user account I get the error

Cannot open Service Control Manager on computer '.'. This operation might require other privileges. ---> System.ComponentModel.Win32Exception: Access is denied

the local account has the privileges to serve as a app pool user in IIS. When I switch to the default app pool with ApplicationPoolIdentity as the identity, the service runs fine.

Which privileges do i miss? ( I also added the user to the administrators group.

the server is a windows 2016 standard server and the code is writen in c#, .net 4.8

I tried to add the user to the administrator group. in the local group policy editor added the IIS APPPOOL<App pool> to the following user rights assignments:

  • Generate Sevurity audits
  • log on as a service
  • replace a process level token

which rights or privileges do i miss that the ApplicationPoolIdentity has.

0

There are 0 best solutions below