0

I am new to building Windows Services, As a learning exercise I am following the template provided by Visual Studio in order to write a service which will block specific users from using the CD drive and logging attempts to a file. I haven't been able to find documentation that would allow me to 1) prevent non-elevated users from stopping or restarting the service and 2) force the service to run as NT Authority\SYSTEM and prevent the user from changng the 'run as' user. Any tips would be appreciated. I have searched the internet and stack overflowbut perhaps I just dont know enough about services or the relevant terminology to find what I need. Thanks in advance!

Josh Barton
  • 148
  • 11

1 Answers1

0

I rewrote my project to take advantage of PSService a PowerShell script by JFLarvoire (available on GitHub) which dynamically generates a customizable Windows Service executable. You can reconfigure PSService to specify what user the service should run as but by default it runs as the SYSTEM account which met my needs perfectly. Further research has also shown that unprivileged Windows users can start a system service but cannot stop them unless they have been granted permission to do so.

Josh Barton
  • 148
  • 11