/ Published in: Maxscript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
fn checkService ServiceName server = ( dotnet.loadassembly "System.ServiceProcess" sc = dotNetObject "System.ServiceProcess.ServiceController" if (server == "") do server = "." -- if no server is supplied, run the check on the local machine sc.Machinename = server try(scServices = sc.GetServices(server))catch(return "Timed Out") for scTemp in scServices do ( if (scTemp.ServiceName as string == ServiceName) then ( --print ( ServiceName + " - " + server + " - " +scTemp.Status.toString() ) return scTemp.Status.ToString() ) ) return "Service Not found" )