' Set the process to look for sProcess = "notepad.exe" ' Get the device address sDeviceAddr = Context.GetProperty("Address") ' Get the Windows credentials for the device sWinUser = Context.GetProperty("CredWindows:DomainAndUserid") sWinPass = Context.GetProperty("CredWindows:Password") ' Connect to target machine via WMI and query for process Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objSWbemLocator.ConnectServer(sDeviceAddr,"root\cimv2",sWinUser, sWinPass) Set sProcess = objWMIService.ExecQuery("SELECT * FROM Win32_Process where Caption='" & sProcess & "'") If sProcess.count = "0" Then ' WScript.Echo "Process not running" Context.SetResult 1,"Process not running" ELSE ' WScript.Echo "Process running" Context.SetResult 0,"Process running" END IF