I have tried a test of getting the event log output and that I get to work.
I have tried using a FOR loop to output each line which is then piped to a find command but when it displays the result I have apparently screwed up the FOR command because I do not get a complete line, i.e. look for Event ID: and I get Event when %%A should be EVENT ID: ####. Note that each line I want is then appended to a previous line or an empty line.
Can someone help cuz I have invested a bunch of time and this should be a simple solution — I hope, the simple one said.
set EnableDelayedExpansion set line=”” for /f “delims= ” %%A in (‘wevtutil qe Security /rd:true /f:text /c:1’) do (if echo %%A | find “Date:” set line=”%%A ” if echo %%A | find “Event ID:” set line=”!line!%%A ” if echo %%A | find “Task:” set line=!line!%%A ” if echo %%A | find “Security ID:” set line=!line!%%A ” if echo %%A | find “Account Name:” set line=!line!%%A ” if echo %%A | find “Account Domain:” ( set line=!line!%%A” echo %line% >> bidslog.txt set line=”” :FINI )
Thanks in advance for any help!!