I'm not sure how simple a request this is going to be, but i'm going to give it a shot.
Right now i've been doing some analysis of the security log in my events viewer. I made up a simple batch file that runs eventquery then opens up the resulting csv in excel. this code is here:
echo off
cls
cscript //h:cscript //s //nologo
cls
echo This Script will list all the user logins on a computer you specify. Please note that by querying a computer, your user name will show up as a successful login on the event log of the remote computer.
echo.
set /p compname=Serial Number:
eventquery /s %compname% /fi "type eq successaudit" /fi "ID eq 528 OR ID eq 551" /fi "category eq Logon/Logoff" /fi "user ne NT AUTHORITY\NETWORK SERVICE" /fi "user ne NT AUTHORITY\SYSTEM" /fi "user ne NT AUTHORITY\LOCAL SERVICE" /fi "user ne NT AUTHORITY\ANONYMOUS LOGON" /v /fo csv /l security > %WINDIR%\temp\%compname%.csv
start %WINDIR%\temp\%compname%.csv
This produces an unwieldy huge excel spreadsheet thats tough to read. What I would /Like/ my script to do is:
1) Call event query and save the CSV
2) Apply conditional formatting rules to a column. (Eg, 551 pops up in red, 528 pops up in green)
3) Open it in excel.
I'm pretty sure this requires a jump to VB. I don't know a lot about vb, i've done some research on the ApExcel libiary and i'm not coming up with any results to applying conditional formatting. I understand that CSV does not contain any formatting as well, so i'm not sure if a conversion of the format needs to be dont first.
Thank you in advance for your help :3