leederbyshire.com  Mobile web applications for Microsoft Exchange Server.

OWA Logging Exchange 2003

Exchange 2003 Outlook Web Access Logging

Back to Articles page

Making any kind of modification to OWA 2003 is difficult, since there are no .ASP files that can be edited. It's possible to make some changes to the JavaScript include files, though. Here is how you can use .js file editing to log OWA 2003 access.

First, use Notepad to create a file named OWALogger.asp in the root of your Default Web Site. Here are the contents of the file:

  s = Request.ServerVariables("HTTP_REFERER")
  If Right(UCase(s), 12) = "/?CMD=NAVBAR" Then
    p = InstrRev(s, "/")
    p2 = InstrRev(s, "/", p - 1) + 1
    s2 = Mid(s, p2, p - p2)
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set f = fso.OpenTextFile("C:\OWALog.txt", 8, True)
    f.Write Date & ","
    f.Write Time & ","
    f.Write Request.ServerVariables("REMOTE_ADDR") & ","
    f.Write s2
    f.Write vbCrLf
    Set f = Nothing
    Set fso = Nothing
  End If

Then, in IIS Manager, view the permissions on the OWALogonID.asp file. Ensure that Anonymous Authentication is enabled.

Next, use Notepad to create an empty file named OWALog.txt in the root of your Default Web Site. Make sure that the Internet Guest account has write access to the file.

Next, locate a file named vw_Navbar.js . At the time of writing, it is located in C:\Program Files\Exchsrvr\exchweb\6.5.7651.60\controls , although with future service packs and updates, that last folder name will be higher. The vw_Navbar.js file is the one that needs editing, so before doing anything else, copy and paste a backup copy into the same folder. Next, open the file in Notepad (you can probably do this with right-click -> Edit). About 226 lines into the file, there is a line that looks like this:

  function window.onload()

Immediately after the opening brace { on the next line insert the following text:

  var o = new ActiveXObject("Microsoft.XMLHTTP");
  o.open("GET", "/OWALogger.asp", false);

So that that part of the file looks something like this:

  function window.onload()
  var o = new ActiveXObject("Microsoft.XMLHTTP");
  o.open("GET", "/OWALogger.asp", false);

        if (!g_sBase) return(false);

Now, when your clients next access OWA, their usernames, and the date, time and their IP address, will be written to a file named OWALog.txt in the root of your C: drive. You can easily change this to a different location but make sure that IIS has write permission on the file.

Note - your clients will need to clear their Temporary Internet Files before this will work because the original .js file is usually cached client-side. Also, this will only work for the full JavaScript-enabled 'Premium' OWA client - it will not work for clients using non-MS browsers, or FBA with the 'Basic' client selected.

Outlook Web With PDA
Copyright © 2018 Lee Derbyshire. All rights reserved.