Archive for October, 2010

Creating a custom Forefront TMG 2010 OWA FBA logon page

October 22, 2010 30 comments

Today I looked for a solution to edit the default OWA logon page. In our company we use a Form Based Authentication that is configured on a Forefront TMG 2010 server. Currently we are running an Exchange 2003 SP2 Frontend server. The OWA logon page looks like this by default:


There is a way to configure this to our liking. Kay Sellenrode of made an FBAeditor to configure this in an easy way. This tool does not have a way to change the color of the logon button and explanation text so at the end of this post i show you how to change that as well. So lets create some fancy company OWA logon screens.

FBAeditor – can be found here (
Company logo 115 x 456 pixels in GIF format
Company logo 115 x 500 pixels in GIF format


  • First make a backup of C:\Program Files\Microsoft Forefront Threat Management Gateway\Templates\CookieAuthTemplates\ with all sub directories
  • Run FBAeditor on the TMG server and browse to C:\Program Files\Microsoft Forefront Threat Management Gateway\Templates\CookieAuthTemplates\Exchange\HTML\ (click on Source Dir)

  •  Now change the page you want to edit to : usr_pwd.htm (1.)
  • Picture name : lgntopl.gif (2.)
  • Text Language : select your country (3.)
  • Select your new company logo (4.)
  • Select apply to all pages and click apply. (5.) Now all htm files will be changed with the new company logo.
  • By pressing Preview Page you can take a look on how its going to be. (6.)

  • Many organizations don’t have 2 or more domains so we can change the domain\username text to Username
  • Now change the page you want to edit to : usr_pwd.htm (1.)
  • Select username (2.)
  • Change the text from domain\username to Username  (3.)
  • Confirm the change by clicking Change Text (4.)

  • When you are clicking on Preview Page you will see that the button and the explanation text has a color that does not match with the rest of the logon page. There is not a way that you can change this via the FBAeditor tool. We can achieve this by editing a file manually.

  • Start notepad and browse to C:\Program Files\Microsoft Forefront Threat Management Gateway\Templates\CookieAuthTemplates\Exchange\HTML\logon_style.ccs
  • When looking through the file you’ll see a section that has entries like #eb9c12 and #f9b133. These are the colors used by the logon button.

  • You can change this by entering your own required color. You can find the color codes here
  • To change the explanation text you must look for the entries #ff6c00

  • You can change this by entering your own required color. You can find the color codes here
  • Also it is possible to change the Internet Explorer tab name by starting the FBAeditor en change the OWAWindowTitle text box to your liking
  • If required you can change the ISA html files as well they can be found here C:\Program Files\Microsoft Forefront Threat Management Gateway\Templates\CookieAuthTemplates\ISA\HTML\
  • If all went well you have a fancy FBA logon page like this :

  • Note: I found out that the Forefront TMG caches these pages somehow so I had to reboot the server to get the new pages active. -> Arturo pointed out that you only need to start the firewall service to reflect these changes.

Generate passwords into an Excel file

October 18, 2010 Leave a comment

There are alot of user accounts mutations when a new school year starts. Creating hunderds of new user accounts can be a hassle and all those new accounts also need an password. This little script will generate passwords and place them into an excel file. This excel file can be used to create all those accounts with the generated password.

‘enable debugging
Option Explicit

‘create memory for objects
Dim objExcelRange, objExcelRange1, objExcelRange2, objExcel, objExcelWorkbook, objExcelCell
Dim objPasswordLoops, objRandomCharacter, objPasswordMFactor, objPasswordNumber, objPasswordChar, objPasswordNext

‘define globale constants
Const strExcelFileName = “D:\student.xls”
Const strExcelBoxTitle = “Password Generator for an Excelfile”
Const strPasswordLength = 6
Const  strPasswordCharacters = “abc1de2fg3hi4jk5lm6no7pqrs9tuvw0xyz”

‘asking for values
objExcelRange1=InputBox(“Enter value for the first cell” & VBCRLF & “(Example: G2) :”,strExcelBoxTitle,”G2″)
objExcelRange2=InputBox(“Enter value for the last cell” & VBCRLF & “(Example: G100) :”,strExcelBoxTitle,”G100″)
objExcelRange = objExcelRange1 & “:” & objExcelRange2

‘create an excel instance and open workbook
Set objExcel = CreateObject(“Excel.Application”)
Set objExcelWorkbook = objExcel.Workbooks.Open(strExcelFileName)

‘generate password for every cell entered into inputbox
For Each objExcelCell In objExcel.Range(objExcelRange)
 objExcelCell.Value = StrPassword(strPasswordLength,strPasswordCharacters)

‘close and save excelfile
objExcelWorkbook.SaveAs strExcelFileName

‘***********************      Functions       ****************************
Function GenIt(objPasswordMFactor)
end Function
Function StrPassword(strPasswordLength,strPasswordCharacters)

StrPassword = “”

objPasswordMFactor = Len(strPasswordCharacters)

For objPasswordNumber=1 to strPasswordLength
 objPasswordChar = GenIt(objPasswordMFactor)
 objPasswordNext = Mid(strPasswordCharacters,objPasswordChar,1)
 StrPassword = StrPassword & objPasswordNext
End Function

%d bloggers like this: