Option Explicit Dim iOK, oShellQ, iRetQ, sPath, sTemp, oNetwork,pass,MYERRMSG On Error Resume Next iOK = True wscript.echo "Checking ESE Services..." pass = 0 If CheckService = False Then wscript.echo "ESE is not running !!" iOK = False End If If iOK = False Then wscript.echo "Please install ESE" & BR(1) Dim objIE Set objIE = WScript.CreateObject ("InternetExplorer.Application") ObjIE.Toolbar = false ObjIE.statusbar = false objIE.Navigate "http://www.opswat.com" objIE.Visible = true Else wscript.echo "ESE Security tests passed !!" Set oNetwork = WScript.CreateObject("WScript.Network") Set oShellQ = WScript.CreateObject ("WSCript.shell") sPath = Mid(WScript.ScriptFullName , 1, InStrRev(WScript.ScriptFullName, "\")) wscript.echo "Notifing Remote Network Access Quarantine Control" sTemp = sPath & "rqc.exe " & _ getResource("ConnName") & " " & _ getResource("TunnelConnName") & " " & _ getResource("Port") & " " & _ getResource("Domain") & " " & _ oNetwork.UserName & " " & _ getResource("ScriptVer") iRetQ = oShellQ.run(sTemp , 0 , True) sTemp = getResource("ERRORLEVEL") Select Case sTemp Case "0" MYERRMSG ="Success!" Case "1" MYERRMSG ="Unable to contact remote access gateway. Quarantine support may be disabled." Case "2" MYERRMSG ="Access denied. Please install the Connection Manager profile from http://www.corpnet.example.com/remote_access_tshoot.asp and reconnect." Case Else MYERRMSG= "Unknown failure. The client will remain in quarantine mode." End Select wscript.echo MYERRMSG Set oShellQ = Nothing Set oNetwork = Nothing End If '--- Check listed services. Function CheckService Dim objecttest Dim val1 Dim val2 Dim val3 Dim val4 Set objecttest = CreateObject("VPNGuardService.Service.1") val1 = objecttest.IsUIEnabled() val2 = objecttest.GetAlertMessage() val3 = objecttest.GetVerificationStatus(val4) If val3 = 1 Then MsgBox "ESE" & ": " & "CHECK PASSED" MsgBox "ESE" & ": " & val2 & VAL4 CheckService=TRUE Else MsgBox "ESE" & ": " & "CHECK FAILED" MsgBox "ESE" & ": " & val2 & VAL4 CheckService=False End If End Function Function BR(iRow) Dim iCountBR For iCountBR = 1 To iRow BR = BR & Chr(13) & Chr(10) Next End Function