View Single Post
  #1 (permalink)  
Old 07-09-2009, 09:28 AM
habs3 habs3 is offline
BES Activated
 
Join Date: Jul 2009
Location: N/A
Posts: 9
Talking script to check logs

Hi All

This is my first post and i though i would start with an addition.

This script will prompt for a bes server, a messageant the user is in and then the error or users name. I will return anything with the users name in it or anything with th error messge. I have found this wot work great when you are looking for a specific issue or to see if many users are being affected. If there are any questions or issues pleas elet me know.

cls
@Echo Off
REM This will allow parsing of bes logs
REM ***************sets proper date format********************

FOR /f "tokens=1-4 delims=/ " %%G IN ('ECHO %date%') DO (
SET MN=%%H
SET DY=%%I
SET YR=%%J)

REM ********************Asks for input for proper agent log ****************

set INPUT=
set /P INPUT=Enter Bes Server user is on: %=%

if %input% == "put your bes server name here without quotes" goto bes1
if %input% == "put your bes server name here without quotes"

REM ***** This is the part that parses the information *********

:bes1
set log=
set /P log=Enter message Agent(can be found in email error message): %=%
set / usr=
set /p usr=Enter NT Logon Name or Error:%=%

find /i "%usr%" "BES SERVER NAME HERE\Program Files\Research In Motion\BlackBerry Enterprise Server\Logs\%yr%%mn%%dy%\BES SERVER NAME HERE_magt_0%log%_%yr%%mn%%dy%_0001.txt" > "c:\%usr%.txt"
notepad "c:\%usr%.txt"
goto exit


:bes2
set log=
set /P log=Enter message Agent(can be found in email error message): %=%
set / usr=
set /p usr=Enter NT Logon Name or Error:%=%

find /i "%usr%" "\\BES SERVER NAME HERE to full log path\Research In Motion\BlackBerry Enterprise Server\Logs\%yr%%mn%%dy%\BES SERVER NAME HERE_magt_0%log%_%yr%%mn%%dy%_0001.txt" > "c:\%usr%.txt"
notepad "c:\%usr%.txt"
goto exit

pause

:exit
exit
Reply With Quote
Sponsored Links