Reputation: 1220
I try to get a List of all Windows Services + the Service Account
For Example:
servicexyz.exe;Local Service
servicezyx.exe;ADUser123
I already tried ServiceController but I couldn't find a method or property to get the service account...
Upvotes: 0
Views: 1080
Reputation: 54128
Use System.Management
to get this info via native WMI - use the Win32_Service
class as demonstrated in the 'possible dup' I cited above.
This technique can be used for a lot of system-level information that appears on the face of it not to be available in the .Net Framework.
Upvotes: 1