Sep 10 2010

Forgot SQL Password

So you are here because you for got your mater password or didn’t enable SQL authentication and create an SA password on setup and your windows authentication is failing… Well the good news is this should help you change the password.

Below are the steps for SQL 2008 (the same can be applied to 2005, change the paths accordingly)

Follow the steps below to rebuild the Master Database.

1. From a command prompt window change to the following directory:

"C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release"

2. Next paste the following into the command prompt window and press “Enter”:

Setup.Exe /Action=RebuildDatabase /InstanceName=MSSQLSERVER /SqlSysAdminAccounts=domain\UserName

The instance name will be MSSQLSERVER unless you are using a named instance and in that case change MSSQLSERVER to your instance name and the SqlSysAdminAccounts will be an account with SysAdmin (Be sure to change the domain\username details) rights then and press “Enter” again.

That should do it!

Aug 19 2010

Free GPS Navigation for Android with Google

I was always very envious of the US and UK, where Google had released there fully blown GPS navigation to the public via Android phones. And then I stumbled upon a post back over at the great guys at XDA, and it would seem someone has come up with a hack to allow the GPS navigation for Google for ALL countries!

I have loaded it up and run it on my Desire, and wow is this thing extremely accurate, even more so than my dedicated tom tom unit.

GPS locks almost immediately, unlike my old windows mobile touch pro

The only complaints I have is, well its still Google maps so its using data, if only it could download the maps to the SD card, it would just be so much sweeter.

And the voices, the very much a Droid voice is hard to understand as it speaks a little fast, as it says the street name and the turn IE. ‘Continue on Bond street, and turn left into Daisy road’  I think this feature is great that it is saying the street names unlike other GPS solutions but they need a better voice, something more human than robotic.

Anyways enough of my chit chat you want the download right?!


Just download & install. Then you will have both original and modded maps installed at once.

Install can be done via an app installer installed on the device or via the Android SDK


For further info refer to the original post at XDA –

Jul 19 2010

Redirect based on the URL using JavaScript


There are many methods out there to do such a task, it seem many PHP solutions for this and also some JavaScript functions to do this, but they all seem overkill in terms of what’s required to be changes for each redirect.

here is a script with minimal changes required to get it working, this solution is based on the ever popular JavaScript.

A perfect example of using a script like this is if you are trying to target a particular market, for example. I am based in Australia, and I have a domain, and a .com domain. I might have a different offering or market to what I offer in Australia, so with that said I have 1 website but with multiple alias’s and pages for different markets. I need to somehow separate these with the URL, as tells me AU, .com tells me global.

So how do you use the below script easy:



to your domain (without the www) and folder location


Change this to be your location you wish to redirect to

this is the second URL you want it to redirect too.



<script language="javascript">



    var href = document.location.href;


    if (href.indexOf("") > 0) 

        document.location.href =""


        document.location.href =""






May 17 2010

AD Based Outlook Email Signature for 2003, 2007 and NOW 2010!!!

Due to the popularity of this script there is no way I could not support 2010 also so here it is!

For those newbie’s to my blog, welcome and here is the full script:
(I also suggest before posting any questions you might have refer to the implementation guide posted some time ago)



' VBScript: <Signatures.vbs>

' AUTHOR: Peter Aarts

' Contact Info:

' Version 2.04

' Date: January 20, 2006

' Moddified By Brad Marsh Now works with both 2003 and 2007 outlook 

' Contact:

' Date 20 May 2010

' Tested on windows 7, Vista, XP, XP64 and office 2003, 2007 and 2010. 

' NOTE will not work that well with various email accounts



'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 = ""


' 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, RegKey10, 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"

RegKey10 = "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\General"

RegKey07 = RegKey07 & "\Signatures"

RegKey10 = RegKey10 & "\Signatures"

RegKey = RegKey & "\Signatures"

objShell.RegWrite RegKey , "AD_Gentex"

objShell.RegWrite RegKey07 , "AD_Gentex"

objShell.RegWrite RegKey10 , "AD_Gentex"

UserDataPath = ObjShell.ExpandEnvironmentStrings("%appdata%")

FolderLocation = UserDataPath &"\Microsoft\AD_Gentex\"

HTMFileString = FolderLocation & "Gentex.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&"Gentex.rtf")


Set AFile = objFSO.GetFile(Folderlocation&"Gentex.txt")



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=><font color=#696969></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=> <img src= border=0></a>" & vbCrLf

objfile.write "<br>" & vbCrLf

objfile.write "<img src=>" & 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 Gentex Technology Pty Ltd</font>"  & vbCrLf

objfile.write "</FONT></BODY></HTML>" & vbCrLf


' ===========================

' 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("Gentex","")


' 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

For those running the script already, why not update it so you have the additional support, or those that have upgraded to 2010, you don’t have to wait any longer here is the section of the script you must change

' 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, RegKey10, 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"

RegKey10 = "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\General"

RegKey07 = RegKey07 & "\Signatures"

RegKey10 = RegKey10 & "\Signatures"

RegKey = RegKey & "\Signatures"

objShell.RegWrite RegKey , "AD_Gentex"

objShell.RegWrite RegKey07 , "AD_Gentex"

objShell.RegWrite RegKey10 , "AD_Gentex"

UserDataPath = ObjShell.ExpandEnvironmentStrings("%appdata%")

FolderLocation = UserDataPath &"\Microsoft\AD_Gentex\"

HTMFileString = FolderLocation & "Gentex.htm"

Remember for both scripts you need to change the ‘gentex’ with your organisation’s name etc. once again refer to the implementation guide before asking any questions.


for the history of all articles published regarding this script see below:



Apr 23 2010

Useful FREE business apps

It’s been a while since my last blog post, what a busy year it has been.

Excuses aside, I thought I would take the time out to share  my findings and experience with ZOHO products…. While I used the ZOHO projects (which is essentially a project management software online) some time ago, I recently logged back in and and had had a look at some of there other offerings, and I have got to say wow haven’t they done some work!

They have in total about 22 web based applications, all of which have there use, but some more so than others, especially the business applications, such as CRM, Projects, Meetings, Invoices, Creator.  These online apps give you amazing amounts of functionality and some with even better flexibility to tailor it to your business needs.   While some applications may not meet the needs for large enterprise business, they certainly could be utilized for the SMB market.

Take for example the Zoho creator, it gives the business / user a simple UI, it also provides advanced users script to create databases that have almost no limit, if you had the time and patience, you could create yourself a CRM system, assets management.

The best thing about the Zoho products is that they are free, well at least to a degree, for super small business you actually be able to get away with using them all for free, as they impose limits on users / and or functions per month. but they also do have really quite affordable pricing models.

Check it all out for yourself:

NOTE: I am in no way associated with Zoho, nor am I receiving any finical gain. I am simply a user evaluating and enjoying my experience with there applications.

Oct 21 2009

Redirect pages to HTTPS in IIS

Some times there is a need for clients to have only particular pages protected by and SSL Cert. which means we need to create a redirect to HTTPS, this could be done on the page level through the code, but there is a better way, via IIS, let me show you how.

First thing is first ensure you have installed your  valid SSL onto your IIS Server, once its installed you should be able to view the certificate, and will look something like this:



Next you need to select which files or folders you want to have protected with your SSL, in other words which pages do you need to be HTTPS:// on, in this case I have selected the ‘login’ folder on my website, within IIS locate the folder or file right click on it and choose ‘Properties’ .

If you selected a folder look for the ‘Directory Security’ Tab

If you selected a file look for the ‘File Security’ Tab.

Select the appropriate tab, toward the bottom within the ‘Secure Communications’ you will see an ‘Edit’ button click this, you will then be prompted with a pop-up box with some additional options, here you will notice that ‘Require secure channel (SSL)’ and ‘Require 128-bit encryption’ are not ticked, tick both of these options, then press OK. And Ok once more.



Because all requests to the folder or file you have set now MUST use HTTPS, people by default will get a  generic IIS 403.4 error, to prevent this error and redirect the user to the HTTPS link you must perform a redirect. IIS can do this for you.


Above we show the HTTP errors that IIS contains, change the highlighted one to use a custom script for redirection to HTTPS:

I have called mine RedirectSSL.Htm and replaced the default 403.4.htm with the custom error.

Note: The above custom error should be set at the website level

Ensure the custom error has the following contents

<SCRIPT type=text/javascript>
if (location.protocol != ‘https:’)
window.location = ‘https://’+ + location.pathname +;
//alert( + location.pathname +; Just for sanity check
// –>

This script will change your URL to add the HTTPS prefix, by using this as your landing page for the error 403.4 the user will be re-directed to the URL with HTTPS in front forcing them to use your SSL.

Oct 3 2008

Search all tables in Database

I recently came a cross a very handy script, where you can quickly search through your database for a specified string;

find the script below:

Oct 10 2007

What its all about…

So i am taking the plunge into the whole world of Blogs, We this Blogs will be generally about techie stuff, gadgets and new bits and pieces, stuff that i have had personal experience with and i feel compelled to share my findings with the WWW.

So sit back read and enjoy…..