Question : use vb to determine a windows service LogOn AS?

I need a way to get the information for a service using vb.net 2005
I have a service called "My test Service"
I need to capture if it is using Log on as
 Local System Account
or
This account

If this account then we have that account info l

Answer : use vb to determine a windows service LogOn AS?

Dim mcServices As New Management.ManagementClass("Win32_Service")
        Dim moService As Management.ManagementObject
        For Each moService In mcServices.GetInstances()
            'Dim srvArray As String()
            'srvArray =
            If moService.GetPropertyValue("Name").ToString() = "MyServiceName" Then
                MessageBox.Show(moService.GetPropertyValue("StartName").ToString())
            End If
        Next
Random Solutions  
 
programming4us programming4us