Thanks for all the replies and ideas. Okay, here's the script edited for my environment:

 Code:
$odbcName = "tess_live_readonly"			; SET THIS TO THE NAME OF THE ODBC YOU WANT TO CHECK FOR
$logfile = "C:\ODBC_LOG.txt"				; SET THIS TO THE PATH OF THE LOG FILE YOU WOULD TO WRITE TO
REM $logfile = "\\fileserver\goldshare\ODBC_LOG.txt"	; SET THIS TO THE PATH OF THE LOG FILE YOU WOULD TO WRITE TO

If KeyExist("HKCU\Software\ODBC\ODBC.INI\" + $odbcName) Or KeyExist("HKLM\Software\ODBC\ODBC.INI\" + $odbcName)
   $nul = RedirectOutput($logfile)
   ? @Date+" - "+@Time+" - "+$odbcname+" Found on "+@WkSta+" under user "+@UserID	; CAN MODIFY THIS TO WHAT EVER YOU WOULD LIKE TO BE LOGGED
   $nul = RedirectOutput("")
Endif


I changed the location of the log file to my local C: because it wasn't working pointing to the fileserver share, but the problem is that it doesn't seem to be working going to my C: drive either. I do have an ODBC connection named tess_live_readonly in the HKLM key but a log file isn't being written. I don't see a problem in the script so what might be the issue?


Edited by Mart (2013-03-11 09:13 AM)
Edit Reason: Please use code tags when posting code.