I have a vb.net forms application that checks the status, stops and starts services on remote computers.
It works well, except i need to be able to run it as a user that does not have permissions to perform those operations.
Any idea how i can elevate the permissions in my code... here is one of the functions. Thanks for the help
Public Function StopService(ByVal PC As String, ByVal Service As String) As Boolean
Dim obj As ManagementObject
Dim sc As ServiceController
obj = New ManagementObject("\\" & PC & "\root\cimv2:Win32_Service.Name='" & Service & "'")
' Stop the service
If obj("State").ToString = "Running" Then
' now start the service
sc = New ServiceController(Service, PC)