leederbyshire.com  Mobile web applications for Microsoft Exchange Server.
HOME OWA FOR PDA BUY ONLINE DOWNLOADS TESTIMONIALS SCREENSHOTS FAQ MANUAL (WIP) UPGRADE ARTICLES CONTACT

OWA Logging Exchange 5.5

Exchange 5.5 Outlook Web Access Logging

Back to Articles page

Access logging to an Outlook Web Access site can be achieved by making a small modification to the file LOGONFRM.ASP . This file is usually located in folder C:\EXCHSRVR\WEBDATA\USA . Site access is logged to file C:\OWA.log , but you can change this by specifying an alternate location in the second line of the code. Items logged are; date, time, IP address, mailbox name and NT user account name.

Before you modify this file, MAKE A BACKUP of your original!

These are the lines that need to be inserted into the file, at the beginning of the subroutine RedirectToRequest in the ASP file:

  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile("C:\OWA.log", 8, True)
  f.Write Date & ","
  f.Write Time & ","
  f.Write Request.ServerVariables("REMOTE_ADDR") & ","
  f.Write Request.QueryString("mailbox") & ","
  f.Write Request.ServerVariables("REMOTE_USER")
  f.Write vbCrLf
  f.Close
  Set f = Nothing
  Set fso = Nothing

After the lines have been inserted, the beginning of your LOGONFRM.ASP should look something like this:

<% @ LANGUAGE=VBSCRIPT CODEPAGE = 1252 %>
<!--#include file="constant.inc" -->
<!--#include file="lib/session.inc" -->
<!--#include file="lib/logon.inc" -->
<!--#include file="lib/pageutil.inc" -->
<%
'=======================
' RedirectToRequest
' Redirects user to their originally requested URL
'=======================
Sub RedirectToRequest

	On Error Resume Next

	Set fso = CreateObject("Scripting.FileSystemObject")
	Set f = fso.OpenTextFile("C:\OWA.log", 8, True)
	f.Write Date & ","
	f.Write Time & ","
	f.Write Request.ServerVariables("REMOTE_ADDR") & ","
	f.Write Request.QueryString("mailbox") & ","
	f.Write Request.ServerVariables("REMOTE_USER")
	f.Write vbCrLf
	f.Close
	Set f = Nothing
	Set fso = Nothing

	bstrPgReq = Session(bstrURLReq)
	Session(bstrURLReq) = 0

	If (bstrPgReq <> 0) Then
		If InStr(1, bstrPgReq, ".asp", vbTextCompare) Then
			' WARNING! No script after this line will be executed!
			Response.Redirect bstrPgReq
		End If
	End If

End Sub

(Rest of file LOGONFRM.ASP omitted.)

Outlook Web App For iPad
Copyright © 2017 Lee Derbyshire. All rights reserved.