The conditions are - I don't have administrator privilege - I want to see the status of a service in remote machine (server)
I use the following code (vb.net with framework 2.0) to see the status
Dim sqlSvc As ServiceController
Svc = New ServiceController(My.Settings.serviceName, My.Settings.machineName)
If sqlSvc.Status.ToString.Equals("Running") Then
displayStatus("success", sqlSvc.Status.ToString)
Else
displayStatus("error", sqlSvc.Status.ToString)
End If
When running the code, InvalidOperationException
is raised and found out that I need admin right in the server.
Can I lookup the status of the service without having admin right in remote machine ?