Add domain to Exchange FBA

By | December 18, 2007

Have you ever wanted to make logging in easier for your users. With Exchange 2003 and form based authentication, the users have to type in domainname\username in order for it to authenticate correctly. Here is what you have to do to get rid of this “feature”

Navigate to
C:\Program Files\Exchsrvr\exchweb\bin\auth\usa

In here we are looking for logon.asp
First make a backup of logon.asp
Open logon.asp in a text editor

Run a search for <% If g_fIsMSIE5Rich Then %>  
The second one is the one we are looking for.

The area you are now in should look something like this:

<% If g_fIsMSIE5Rich Then %>
<BODY scroll=”AUTO” bgColor=”#3D5FA3″ text=”#000000″ leftMargin=0 topMargin=0>
<FORM action=”/exchweb/bin/auth/owaauth.dll” method=”POST” name=”logonForm” autocomplete=”off”>
<% Else %>
<BODY scroll=”AUTO” bgColor=”#FFFFFF” text=”#000000″ onload=”window.document.logonForm.username.focus()”>
<FORM action=”/exchweb/bin/auth/owaauth.dll” method=”POST” name=”logonForm”>
<% End If %>

Replace BOTH instances of:

<FORM action=”/exchweb/bin/auth/owaauth.dll” method=”POST” name=”logonForm” autocomplete=”off”>

With
———-COPY EVERYTHING BELOW THIS LINE———-
<script Language=javascript>
<!–
function logonForm_onsubmit()
{
if (logonForm.username.value.indexOf(“@”) !=-1)
{
return true;
}
logonForm.username.value = “NetBIOS_domain_name_here\\” + logonForm.username.value;
return false;
}
//–>
</script>
<FORM action=”/exchweb/bin/auth/owaauth.dll” method=”POST” name=”logonForm” autocomplete=”off” onsubmit=”logonForm_onsubmit()”>
———-COPY EVERYTHING ABOVE THIS LINE———-

Remember to replace NetBIOS_domain_name_here in above code with your own NetBIOS domain name.

After this you might was to change where the page states to enter domainname\username on the form.

To do this, go to line 20 in the logon.asp and change the text from
CONST L_UserName_Text = “Domain\username:”
to
CONST L_UserName_Text = “Username:”

 

This information is provided “AS IS” with no warranties expressed or implied.

Leave a Reply

Your email address will not be published. Required fields are marked *