We have some Windows servers that run various services and we have a situation where sometimes those services just stop. To monitor these services I have written a Windows service that uses the ServiceController to look at the suspect services and check their current status. This works fine when I configure the new service to run under an account which has local admin permissions to the servers in question, but that's not ideal from a security point of view as it grants privileges other than sight of the services on those machines. Ideally, I would like to have an AD account created that can "see" and interrogate the services across all servers (the servers in scope is a list that is bound to widen in future) but have no other privileges on those servers - is this even possible, and if so what are the settings for such an account?
I apologise if this description is a bit vague, so let's say that the service I have written will be installed on ServerA and needs to be able to use the ServiceController to interrogate service "MSSQLSERVER" on ServerB, service "MSSQL$OTHERINSTANCE" on ServerC and services "SOMEOTHERSERVICE" and "RUNNINGOUTOFIDEAS" on ServerD. In addition to this, the list of services to interrogate is held in an MS SQL Server database on ServerZ so the account would need to be able to be connected to that database on that server, so it would need, for my purposes, to be a standard AD account, visible as a user in SQL Server security.
Does anyone have any ideas? Thanks in advance for any suggestions, and thanks for taking the time to read this. Please note: a frame challenge such as "why are you even doing this? You should be doing that" would be just as welcome as a direct answer as I'm not convinced there isn't a better way and I am always happy to learn.