<%
Dim Computer
Dim ComputerName
Dim adsPath
Dim dso
Dim Service
Dim TargetService
TargetService = "NameofService"
username = "username"
password = "password"
ComputerName = "thecomputername"
adsPath = "WinNT://" & ComputerName & ",computer"
Set dso = GetObject("WinNT:")
Set Computer = dso.OpenDSObject(adsPath, username, password, 1)
Set Service = Computer.GetObject("service", TargetService)
If Service.Status = 4 Then
Service.Stop
Service.Start
Response.Write "<br>The " & Service.Name &
" service has been restarted."
Else
If Service.Status = 1 then
Service.Start
Response.Write "<br>The " & Service.Name &
" service has been restarted."
Else
Response.Write "<br>The " & Service.Name &
" service could not be stopped."
End If
End If
%>
Note: user must have admin rights to the server