Jan 30 2009

Prepare for 2007 Exchange Server install

I thought I would blog about this, because we had so many issues, and I found Microsoft’s documentation to be rather poor on this occasion.

However it does explain the steps that need to be done in order to prepare (just not how to execute them easily)

So best to start with a quick read of the article


If you’re not patient and want to skip (little like me) then the steps are in short.


  1. setup /PrepareLegacyExchangePermissions: <domain name here>
    setup /pl <domain name here>
  2. Setup /PrepareSchema
    setup /ps
  3. Setup /PrepareAD [/OrganizationName: <organization name> ]
    setup /p [/on:<organization name>]
  4. Setup /PrepareDomain
    setup /pd


In order to run these commands you must run them from the command prompt on a server that is apart of the domain you are preparing, ensure you have the exchange 07 cd in the dvd drive and <DVD drive letter> then dir ensure you see the ’setup.exe’ and ’setup.com’ files in the DVD drive these should be in the root directory of the DVD


Now run the commands.

If you are unlucky like me you will get a few errors like:

"Exchange 2007 cannot be used with the version of Windows operating system running on this computer."

there are 2 possible reasons that this could happen for

you are trying to run the setup file which is a x64 bit file on a x86 system, you can not do this.

the other reason is that you are running the setup commands on a 2008 server, and you may be running exchange 2007 install not the exchange 2007 SP1. (2008 server requires SP1)

So if you are like us in the postion where you have many x64 bit 2008 servers but no x64 2003 servers then you’re going to have to download the 32 bit Exchange 2007 Management tools

get it from here:


the download is an EXE so I suggest installing winRAR and extracting it rather than installing it (unless you will use it), once extracted you will have the setup files, you can now run all of your prep on a x86 system.


Another good resource is this: http://support.microsoft.com/default.aspx/kb/555854

Jan 23 2009

Windows Mobile 6.5 Pre Release Beta Leaked


So it seems as though Windows Mobile 6.5 has been leaked already, there are some skeptical’s out there, saying its just a modified 6.1 release, but I am defiantly a believer that this is 6.5, the way the scrolling effect is shown, looks beyond anything else that other vendors such as Sony, HTC and Samsung have been able to do with the programs . The home screen seems to match the previous screen shots seen of 6.5.

some of the updates to 6.5 so far

  • TouchRecognizer
  • Touch LockScreen
  • IE6[IE Mobile8.12Pro]2009 Only for 6.5
  • CMHome For WM6.5PRO
  • Live For WM6.5

    Seems you can try it out for yourself to:

    for touch pro users here:


    other phones


    BE SURE TO READ THE POST, and Flash at your own risk.



    I am going to flash my old dopod 838 pro and see how it goes, I will share my findings.

  • Jan 16 2009

    Gyrator 2 sometimes flips manila AKA Touch Flo 3D

    The people with HTC touch series, more specifically the HD, Pro and Diamond will most likely have installed some form of application that allow them to make real use of the G-Sensor, where when you turn your phone horizontally it will flip the screen accordingly, in most cases this is very useful.

    However I am a user of Gyrator 2 (I cant use GSEN as this is only useful for diamond users, possibly HD also), Gyrator is an awesome little app, but it seems to flip manila AKA Touch Flo 3d on the occasion. This only happens when you click the application list in the top right, and then turn the screen you will see that manila will flip. Also when the volume control is pressed and turned then it will once again flip. This is rather annoying when you are receiving a phone call or just getting it out of your pocket, and its all messed up.

    Through Gyrator you are able to add your own events, to prevent this from happening, so I thought I would share this with everyone.

    Here  is my events.ini file this is what gyrator reads to perform its magic


    Stylus In (Lock),*,2,1087,8,,0
    Stylus In,*,2,1087,2,/Windows/Default.wav,0
    Stylus Out,*,2,2111,2,/Windows/Default.wav,0
    Power (Manila),Manila,1,16,96,,0
    Disable (Manila),Manila,1,1,1,,0
    Disable (Opera),Opera,1,1,1,,0
    Disable (Teeter),TEETER,1,1,1,,0
    Disable (YouTube),HTCYOUTUBE,1,1,1,,0
    Disable (Camera),IACSP20_Main,1,1,1,,0
    Disable (DIALER),Dialer,1,1,1,,0
    Disable (volume) ,VOLUMECONTROL,1,1,0,,0
    Disable(task manager)  ,ATL:1330510,1,1,0,,0
    Hang Up (Phone),Phone ,1,16,128,,115
    Pickup Call (Phone),Phone – Incoming,1,1,128,,114
    power save,*,1,16,96,,0


    All you have to do to use this is copy and paste over your current events.ini file, it can be found in

    ‘\Program Files\Gyrator2′

    If you installed the applicaction on your device it will be device\Program Files\Gyrator2

    storage card will be storage card\Program Files\Gyrator2

    For this events.ini to function correctly you must be running Version 2008.12.10

    Remember keep a backup of your old events.ini

     EDIT: its worth noting that everytime you reboot your phone a new random number for task manager is created, see the below config item

    Disable(task manager)  ,ATL:1330510,1,1,0,,0

    To correct this simple go into the gyrator config screen, edit the taskmanager event and then choose ‘application’ tab followed by the ‘learn window class’ pull out your styls go to start choose today click on the task manager top right side then put the styles back in with the task manager still open. And then you have the new numbers. Apply it and your done


    Jan 15 2009

    IIS7 logging in Central Location for web farms







    Ok so it appears IIS7 has thought of almost everything this time, and IIS7 is perfect for web Farms now they have the ability to share the configuration file.

    While we are in the mists of setting up a load balanced environment with a IIS7 farm, we have everything working wonders. But when it comes to log files it seems Microsoft missed this. they really should have added in the functionality to combine log files to a central location, while we can prove a UNC path and also log to this, but only one server can do this.

    the problems that you are faced with in a web farm is that:

    If you have shared you ApplicationHost.config which in a web farm, (I highly recommend you do to make your life that little be easier) you will find that y our log file location will be the same on all servers. which could be a problem if:

    you have used a UNC path, all servers in the farm will try and log to this location and only one can win, as the HTTP.SYS for that winning server will keep this open and therefore other servers will not be able to log.

    If you have specified a local path, which really lest face it is your only option, you MUST make 100% sure that location or that drive exists on all of your servers in the web farm.

    Now if you don’t care so much for your log files you will be happy to have them on each server and not collate them. But for the people like us we need them in a central location for a: We like to find our data quickly and be able to find what is going on, on our servers b; we have webstats that we need to be able to provide to our clients or internal staff and c; for a backup / management purpose its just easier to have them centralised.

    So our requirement is to be able to copy all of our log files to one location, keeping of course the web log file structure i.e. W3SVC1, W3SVC2 etc…

    there is one other problem I should tell you, all of the log file names are the same name, so we can just schedule a move / copy script because they will fail or overwrite the other log files, you MUST rename the files before moving. In hind sight we have do this but its a good idea anyway, because this will allow us to easily track down a problem on a server via the logs.

    So we have come up with a script that can be scheduled on a daily basis that will rename all files to the server name_<orginalfilename>.log (this will look in all sub folders i.e. W3SVC1, W3SVC2 etc…) once the name change is done it will then MOVE the files to the central location.

    A Big thanks to Alan Lee for this script, as he wrote the find and replace part (hats off)

    set logs=C:\folder\folderagain
    cd /d %logs%
    dir /b %logs% > tmp.txt
    for /D %%I in ("%logs%") do For /F "tokens=*"  %%J in (tmp.txt) do cd /d %logs%\%%J && for %%i in (u*.log) do move %%i %computername%_%%i 
    del %logs%\tmp.txt
    robocopy %logs% \\servername\FolderName /mov /E /minage:0 /R:3 /W:5 /LOG:%logs%\logs.log

    Of course the script uses robocopy so you will need to include the .exe for this where ever you are executing this .bat from.

    With 2008 Server you can also schedule emails with attachments, might not be a bad idea to attach the log file so you can archive it away.

    Jan 8 2009

    AD Based Outlook Email Signature for 2003 and 2007 Part 4 – Now writes TXT and RTF as well as HTML – Revised.

    (This is a continuation of http://bradmarsh.net/index.php/2008/11/20/ad-based-outlook-email-signature-for-2003-and-2007-part-4-now-writes-txt-and-rtf-as-well-as-html/)

    Ok due to various people having problems with the RTF, where it might show the HTML rather then display correctly, Also it has come to my Attention RTF (not always) will not show images or wont handle them to well.  Other problems where it might not show in outlook also.

    anyway’s this has been tested and all above issues seem to be resolved at least for me :)

    The below is the new section:

    What we are doing here in short is copying the .txt file we have created and then taking the text file and formatting this into something a little more presentable.

    ' Formats the RTF
    Const wdExtend = 1 
    'const wdStory = 6
    'const wdMove = 1
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    'Be sure to change the file name to your desired name
    Set objDoc = objWord.Documents.Open(Folderlocation & "Elcom.rtf")
    Set objSelection = objWord.Selection
    set objSelection = objDoc.Range()
    'objSelection.HomeKey wdExtend
    'you can add more functions IE Bold, underline, different font etc
    objSelection.Font.Size = "10"
    objSelection.Font.Name = "Arial"
    'Save the file
    'Be sure to change the file name to your desired name
    objDoc.SaveAs Folderlocation & "Elcom.rtf", RTF
    ' Close the active document
    'Close Word

    I have used the TXT file, as this removes any images that might become broken. As I originally tried copying the HTML to get the colours and other items. However to do this I would have to call a .exe file that would convert HTML to RTF. This is all fine, but it creates a more complex script, which is something I really wanted to avoid.

    However it would be obviously the optimal way of doing it, this way we get a nice looking RTF with colour.

    I might still do this, but I with the HTML to RTF converter I do have it will not do images.

    If you know of a good HTML to RTF converter that can be called as a .exe then let me know and I might just do the script, otherwise this is the best that I can do for the time being.

    Here is the complete new code:

    ' VBScript: <Signatures.vbs>
    ' AUTHOR: Peter Aarts
    ' Contact Info: peter.aarts@l1.nl
    ' Version 2.04
    ' Date: January 20, 2006
    ' Moddified By Brad Marsh Now works with both 2003 and 2007 outlook 
    ' Contact: gentex@tpg.com.au
    ' Date 19 feb 08
    ' Tested on Vista, XP, XP64 and office 2003 and 2007. 
    ' NOTE will not work that well with various email accounts\
    ' modified: 8 Jan 09 - Brad Marsh
    ' added more support for RTF, copies TXT pulling out images and allows for formatting
    'Option Explicit
    On Error Resume Next  
    Dim qQuery, objSysInfo, objuser
    Dim FullName, EMail, Title, PhoneNumber, MobileNumber, FaxNumber, OfficeLocation, Department
    Dim web_address, FolderLocation, HTMFileString, StreetAddress, Town, State, Company
    Dim ZipCode, PostOfficeBox, UserDataPath  
    ' Read LDAP(Active Directory) information to asigns the user's info to variables.
    Set objSysInfo = CreateObject("ADSystemInfo")
    qQuery = "LDAP://" & objSysInfo.Username
    Set objuser = GetObject(qQuery)  
    FullName = objuser.displayname
    EMail = objuser.mail
    Company = objuser.Company
    Title = objuser.title
    PhoneNumber = objuser.TelephoneNumber
    FaxNumber = objuser.FaxNumber
    OfficeLocation = objuser.physicalDeliveryOfficeName
    StreetAddress = objuser.streetaddress
    PostofficeBox = objuser.postofficebox
    Department = objUser.Department
    ZipCode = objuser.postalcode
    Town = objuser.l
    MobileNumber = objuser.TelephoneMobile
    web_address = "http://www.elcom.com.au" 
    ' This section creates the signature files names and locations.
    ' Corrects Outlook signature folder location. Just to make sure that
    ' Outlook is using the purposed folder defined with variable : FolderLocation
    ' Example is based on Dutch version.
    ' Changing this in a production enviremont might create extra work
    ' all employees are missing their old signatures
    Dim objShell, RegKey, RegKey07, RegKeyParm
    Set objShell = CreateObject("WScript.Shell")
    RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General"
    RegKey07 = "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General"
    RegKey07 = RegKey07 & "\Signatures"
    RegKey = RegKey & "\Signatures"
    objShell.RegWrite RegKey , "AD_elcom"
    objShell.RegWrite RegKey07 , "AD_elcom"
    UserDataPath = ObjShell.ExpandEnvironmentStrings("%appdata%")
    FolderLocation = UserDataPath &"\Microsoft\AD_elcom\"
    HTMFileString = FolderLocation & "Elcom.htm"  
    ' This section disables the change of the signature by the user.
    'objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\NewSignature" , "L1-Handtekening"
    'objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\ReplySignature" , "L1-Handtekening"
    'objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail\EnableLogging" , "0", "REG_DWORD"  
    ' This section checks if the signature directory exits and if not creates one.
    Dim objFS1
    Set objFS1 = CreateObject("Scripting.FileSystemObject")
    If (objFS1.FolderExists(FolderLocation)) Then
    Call objFS1.CreateFolder(FolderLocation)
    End if  
    ' The next section builds the signature file
    Dim objFSO
    Dim objFile,afile
    Dim aQuote
    aQuote = chr(34)  
    ' This section builds the HTML file version
    Set objFSO = CreateObject("Scripting.FileSystemObject")  
    ' This section deletes to other signatures.
    ' These signatures are automaticly created by Outlook 2003.
    Set AFile = objFSO.GetFile(Folderlocation&"Elcom.rtf")
    Set AFile = objFSO.GetFile(Folderlocation&"Elcom.txt")
    ' This adds the Text file, will need to be changed accordingly
    Set objFile = objFSO.CreateTextFile(Folderlocation&"Elcom.txt",True)
    objfile.writeLine ""& FullName & " | " & title & " |  " & title & " | "& Company & " | Australian Technology Park" 
    objfile.writeLine "T +612 " & PhoneNumber & " | F +612 9209 4423 | www.elcom.com.au | " & Email &" "
    objfile.writeLine " "
    objfile.writeLine " "
    objfile.writeLine "--------------------------------------------------------------------------------"
    objfile.writeLine "This email is intended for the intended recipients(s) and may contain confidential information. "
    objfile.writeLine "Reproduction, dissemination or distribution of this message is prohibited unless authorised by the sender."
    objfile.writeLine "If you are not the intended recipient, please notify the sender immediately and you must not read,"
    objfile.writeLine "keep, use, disclose, copy or distribute this email without the sender's prior permission."
    objfile.writeLine "The views expressed by the sender are not necessarily those of Elcom Technology Pty Ltd "
    Set objFile = objFSO.CreateTextFile(HTMFileString,True)
    Set objFile = objFSO.OpenTextFile(HTMFileString, 2)  
    objfile.write "<!DOCTYPE HTML PUBLIC " & aQuote & "-//W3C//DTD HTML 4.0 Transitional//EN" & aQuote & ">" & vbCrLf
    objfile.write "<HTML><HEAD><TITLE>Microsoft Office Outlook Signature</TITLE>" & vbCrLf
    objfile.write "<META http-equiv=Content-Type content=" & aQuote & "text/html; charset=windows-1252" & aQuote & ">" & vbCrLf
    objfile.write "<META content=" & aQuote & "MSHTML 6.00.3790.186" & aQuote & " name=GENERATOR></HEAD>" & vbCrLf
    objfile.write "<body>" & vbCrLf
    objfile.write "<font color=696969 face=" & aQuote & "Arial" & aQuote & "><h6> "& FullName & " | " & title & " | "& Company & " | Australian Technology Park <br>"& vbCrLf
    objfile.write "T +612 " & PhoneNumber & " | F +612 9209 4423 | <a href=http://www.elcom.com.au><font color=#696969>www.elcom.com.au</font></a> |<a href=mailto:" & Email &" > <font color=#696969>" & Email &" " & vbCrLf
    objfile.write "</h6></font></a></B>" & vbCrLf
    objfile.write "</font>" & vbCrLf
    objfile.write "<font color=696969 face=arial><A href=http://www.elcom.com.au/> <img src=http://www.elcom.com.au/images/elcom-logo-web-175x70.gif border=0></a>" & vbCrLf
    objfile.write "<br>" & vbCrLf
    objfile.write "<img src=http://www.elcom.com.au/images/mspartner.jpg>" & vbCrLf
    objfile.write "<br>" & vbCrLf
    objfile.write "</font><font color=696969 size=1 face=arial><br>" & vbCrLf
    objfile.write "<hr size=1 align=left width=465 color=696969>" & vbCrLf
    objfile.write " This email is intended for the intended recipients(s) and may contain confidential information. <br> Reproduction, dissemination or distribution of this message is prohibited unless authorised by the sender.<br> If you are not the intended recipient, please notify the sender immediately and you must not read,<br> keep, use, disclose, copy or distribute this email without the sender's prior permission.<br> The views expressed by the sender are not necessarily those of Elcom Technology Pty Ltd</font>"  & vbCrLf
    objfile.write "</FONT></BODY></HTML>" & vbCrLf
    ' This copies the .htm file and changes it to a RTF format
    'Set the Source and Destination paths below - CHANGE your file name
    Const OverwriteExisting = True
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.CopyFile Folderlocation & "Elcom.txt" , Folderlocation & "Elcom.rtf", OverwriteExisting
    ' Formats the RTF
    Const wdExtend = 1 
    'const wdStory = 6
    'const wdMove = 1
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    'Be sure to change the file name to your desired name
    Set objDoc = objWord.Documents.Open(Folderlocation & "Elcom.rtf")
    Set objSelection = objWord.Selection
    set objSelection = objDoc.Range()
    'objSelection.HomeKey wdExtend
    'you can add more functions IE Bold, underline, different font etc
    objSelection.Font.Size = "10"
    objSelection.Font.Name = "Arial"
    'Save the file
    'Be sure to change the file name to your desired name
    objDoc.SaveAs Folderlocation & "Elcom.rtf", RTF
    ' Close the active document
    'Close Word
    ' ===========================
    ' This section readsout the current Outlook profile and then sets the name of the default Signature
    ' ===========================
    ' Use this version to set all accounts
    ' in the default mail profile
    ' to use a previously created signature  
    Call SetDefaultSignature("Elcom","")  
    ' Use this version (and comment the other) to
    ' modify a named profile.
    'Call SetDefaultSignature _
    ' ("Signature Name", "Profile Name")  
    Sub SetDefaultSignature(strSigName, strProfile)
    Const HKEY_CURRENT_USER = &H80000001
    strComputer = "."  
    If Not IsOutlookRunning Then
    Set objreg = GetObject("winmgmts:" & _
    "{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")
    strKeyPath = "Software\Microsoft\Windows NT\" & _
    "CurrentVersion\Windows " & _
    "Messaging Subsystem\Profiles\"
    ' get default profile name if none specified
    If strProfile = "" Then
    objreg.GetStringValue HKEY_CURRENT_USER, _
    strKeyPath, "DefaultProfile", strProfile
    End If
    ' build array from signature name
    myArray = StringToByteArray(strSigName, True)
    strKeyPath = strKeyPath & strProfile & _
    objreg.EnumKey HKEY_CURRENT_USER, strKeyPath, _
    For Each subkey In arrProfileKeys
    strsubkeypath = strKeyPath & "\" & subkey
    objreg.SetBinaryValue HKEY_CURRENT_USER, _
    strsubkeypath, "New Signature", myArray
    objreg.SetBinaryValue HKEY_CURRENT_USER, _
    strsubkeypath, "Reply-Forward Signature", myArray
    strMsg = "Please shut down Outlook before " & _
    "running this script."
    MsgBox strMsg, vbExclamation, "SetDefaultSignature"
    End If
    End Sub  
    Function IsOutlookRunning()
    strComputer = "."
    strQuery = "Select * from Win32_Process " & _
    "Where Name = 'Outlook.exe'"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    Set colProcesses = objWMIService.ExecQuery(strQuery)
    For Each objProcess In colProcesses
    If UCase(objProcess.Name) = "OUTLOOK.EXE" Then
    IsOutlookRunning = True
    IsOutlookRunning = False
    End If
    End Function  
    Public Function StringToByteArray _
    (Data, NeedNullTerminator)
    Dim strAll
    strAll = StringToHex4(Data)
    If NeedNullTerminator Then
    strAll = strAll & "0000"
    End If
    intLen = Len(strAll) \ 2
    ReDim arr(intLen - 1)
    For i = 1 To Len(strAll) \ 2
    arr(i - 1) = CByte _
    ("&H" & Mid(strAll, (2 * i) - 1, 2))
    StringToByteArray = arr
    End Function  
    Public Function StringToHex4(Data)
    ' Input: normal text
    ' Output: four-character string for each character,
    ' e.g. "3204" for lower-case Russian B,
    ' "6500" for ASCII e
    ' Output: correct characters
    ' needs to reverse order of bytes from 0432
    Dim strAll
    For i = 1 To Len(Data)
    ' get the four-character hex for each character
    strChar = Mid(Data, i, 1)
    strTemp = Right("00" & Hex(AscW(strChar)), 4)
    strAll = strAll & Right(strTemp, 2) & Left(strTemp, 2)
    StringToHex4 = strAll  
    End Function


    Jan 5 2009

    HTC Touch PRO GPS will not Lock onto Location and lags

    Well finally got my touch PRO, and while everything works as to be expected the GPS, is less than impressive.

    Not only for the first time and various times after does it take 5 + minutes to lock on to a location, but the lag is terrible. I must admit I am very surprised HTC haven’t patched this up earlier.

    Any way for those people that just cant get a lock onto their location. I would recommend a GPS viewer to get an idea of what is going on.

    Once installed and running make sure you follow the steps below and  then be  patient, it will get a lock but it will also take some time in my experience, also try walking around, you will see your signal decrees or increase by doing this.

    Download it here



    Guide to lessen the lag effect on the GPS.

    NOTE: I am do not take any responsibility for anything that may go wrong.


    .Net Compact edition 3.5 – http://www.microsoft.com/downloadS/details.aspx?familyid=E3821449-3C6B-42F1-9FD9-0041345B3385&displaylang=en

    Advanced Config 3.2 or better – http://forum.ppcgeeks.com/showthread.php?t=37539 (link to 3.3)

    Registry Editor – Blogged on this recently, or you can find some here:



    Open Advanced Config and choose GPS and follow below:

    1. disable A-GPS
    2. disable GPS logging – delete any text or directory listings
    3. logfile name must be empty – delete any text or directory listings
    4. old logfile name must be empty – delete any text or directory listings
    5. maximum size of logfile must be 0
    6 delete the files : \windows\GPSLogFile.txt and \windows\GPSLogFileBack.txt

    Open your registry editor navigate to:

    HKLM\SYSTEM\CurrentControlSet\GPS Intermediate Driver\

    - Drivers\GpsOneDevice\ Change PollInterval to 100 (default is 1000)
    - Drivers\ change InputBufferSize to 512 (default is 4096)
    - Drivers\ change OutputBufferSize to 512 (default is 4096)
    - Drivers\ change SleepOnNoData to 100 (default is 1000)
    - Multiplexer\ change MaxBufferSize to 512 (by default not present, you have to create it).

    Now soft reset the phone and you should  be good to go. I still have lag but defiantly much better than the factory settings.


    I have now had much quicker locks and better response times with flashing my ROM with a new radio, version: Raphael note my orginal radio rom was:

    find more information here: http://forum.xda-developers.com/showthread.php?t=439566

    If you do flash your radio, do this at your own risk and make sure you read the above thread carefully. I suggest also installing HardSPL for the touch pro. Find this here: http://forum.xda-developers.com/showthread.php?t=410150