Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.
Sub SMTP_STATUS ' this is a subroutine, but could be a function that returns the SMPT status Dim strCommand Dim intSMPTStatus Dim intDosError ' the DOS command will be to query the SMTPSVC status ' I could not figure out how to get the strCommand = "CMD /C SC QUERY SMTPSVC" intStyle = 10 intDOSError = 0 intSMTPStatus = 0 Dim fldTemp, strTempName set fsoRun = CreateObject("Scripting.FileSystemObject") Set fldTemp = fsoRun.GetSpecialFolder(TEMP_FOLDER) strTempName = fldTemp.Path & "\" & fsoRun.GetTempName Dim WshShell Set WshShell = CreateObject("Wscript.Shell") Return = WshShell.Run(strCommand & " >" & strTempName, intStyle, True ) 'Get the output from the command Dim filOutput Set filOutput = fsoRun.OpenTextFile(strTempName, FOR_READING) While Not filOutput.AtEndOfStream strOutput = filOutput.ReadLine objEntry.WriteLine (strOutput) ' This is where I would like to get the SMTP status If InStr(strOutput,"STATE") > 0 And InStr(strOutput,"RUNNING") > 0 Then ' If the status of SMPTSVC is running then flag it as 1 intSMPTStatus = 1 End If Wend filOutput.Close intDOSError = Return 'Delete the temporary file fsoRun.DeleteFile strTempName Set WshShell = Nothing End Sub
|Vbscript output help||10||27|
|VBScript - Find file starting with XXXX use that in runnig rest of code||9||56|
|VBA open file from excel cell||4||33|
|EXCEL: Random Select and Copy 10% of the Row||7||48|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!