Given a service name, I would like to retrieve the username that it runs under (i.e. the username shown in the \'Log On\' tab of a service\'s properties window). There doesn
WMI is your friend. Look at Win32_Service, specifically the StartName property. You can access WMI from C# via the System.Management.ManagementClass.
StartName
If you've not used WMI before, this article seems to be quite a good tutorial.