I can get the current start type of a service on a remote machine but I cannot change it. The ServiceController.StartType property is read-only.
Imports System.ServiceProcess
Dim myController As ServiceController
myController = New ServiceController With {
.MachineName = "hostname",
.ServiceName = "servicename"
}
If .StartType.Equals(ServiceStartMode.Automatic) Then
txtStartTypeSDM1.Text = "AUTOMATIC"
End If
myController.Close()
This guy managed to extend the ServiceController Class that enables changing the StartUpType but it only works locally. The new Class accepts the .MachineName property but I think its broken as it cannot find the specified ServiceName.