Is there a way to quietly run the "wevtutil" command

75 views Asked by At

DESCRIPTION: I have a script that is suppose to be collecting log system information however upon the end of shell script the error that is output by the following command wevtutil epl "$ALOG" "${SYSNAM}_${SAFNAM}.evtx", is Failed to export log.... The problem that I have is this last message that is out

ISSUE: I'm fine with the fact that the command is making the user aware that an error has occurred and (I will address that issue separately). The problem is that the output of this error message affects the printout of the taskbar displayed by the script. In fact at the end of the scripts run the message skews the printout

DESIRED OUTCOME: I would like to either run the wevtutil command above quietly whilst taking note of the errors (potentially by forwarding the error messages to a script_error.txt file, along with a conditional) OR if there is some sort of clever work around that I am not aware of I am willing to attempt that as well either way I would like for the output displayed to the user to be clean rather than skewed.

Here are some examples of the issue I am experiencing below

0

There are 0 answers