Apr 15 2009

Windows Mobile Wrong time zone

I have just done a ROM update on my windows mobile enabled device and while there are many new features, and the integration to hide a lot the old and ugly windows mobile interface is superb, however there is a few things lacking the most important is the Time Zone. While it seems to pick up your timezone based on weather points you use at first. for example Las Vegas GMT –8. Although after entering in Sydney (where I am based) it would at best come up with a +11 naturally this would through the clock out 1 hour.

So if you are having problems with your time zone I suggest the first steps

That seems to fix the bulk of the issues going around with the Windows mobiles, however if you like me have updated your ROM and there seems to no avail in sight.

If your in a +10 time zone your in luck

Here is a registry entry for +10

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\Time]

"TimeZoneInformation"=hex:A8,FD,FF,FF,53,00,79,00,64,00,6E,00,65,00,79,00,20,00,53,00,74,00,61,00,6E,\

      00,64,00,61,00,72,00,64,00,20,00,54,00,69,00,6D,00,65,00,00,00,00,00,00,00,\

      00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,05,\

      00,03,00,00,00,00,00,00,00,00,00,00,00,53,00,79,00,64,00,6E,00,65,00,79,00,\

      20,00,44,00,61,00,79,00,6C,00,69,00,67,00,68,00,74,00,20,00,54,00,69,00,6D,\

      00,65,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\

      00,00,00,00,0A,00,00,00,05,00,02,00,00,00,00,00,00,00,C4,FF,FF,FF

**Copy and save this file as a .REG (yes you can import a registry key in windows mobile) to import the REG file you will need this app – http://www.pocketpcfreeware.mobi/download-task-manager.html

For those with other time zones if you have another mobile device, or an  emulator, you can always change the time zone to the correct location and then from the registry location of ‘HKEY_LOCAL_MACHINE\Time\TimeZoneInformation’ you should be able to copy and replace this on your PDA then your good to go.

 

**NOTE any registry changes are made at your own risk, I take no liability for any damage.


Mar 30 2009

Outlook 2007 constantly consuming 50% + CPU

Just a quick one today. I was recently given a high spec notebook that each time on load with outlook it would consume 50% or more of the CPU.

So I thought it might be a good idea to post on my findings.

 

1. First thing was to disable any and all third party comm add-ins

you can easily find these in tools > Trust Center >  Add in tab (to the left) > click on Go (at the bottom)

Restart outlook.

 

If you still have a high utilization then like me you might be scratching you head.

 

Open outlook and check the calendar, if there are multiple cleaners open close them all off and close outlook and open again.

For me that resolved the issue, the user had about 7+ calendar items open at all times, this is why outlook seemed to be hogging so many resources.

 

Hope this helps


Mar 6 2009

Fix: Windows Mobile Memory Leak

Summary:
Release memory on your HTC Touch Diamond/Pro devices (Windows Mobile), It is a memory reclaimer similar to Oxios but with advanced settings and actually works! this applications is specially for diamond/pro devices! Great solution for the Windows Mobile memory leak problem.

Description:
htcAddicts developed a very useful tool for HTC Touch Diamond/Pro called “cleanRAM”.
The cleanRAM attempts to release as much memory as possible without damaging the internal state of the Windows Mobile device. it’ll refresh/recover your device RAM. This can save you a lot of SOFT RESET!

Configuration Menu:
There are 3 levels of cleaning and Personally customized processes list.
Level 1 – Basic purge only (quick) – Close non-responding tasks without TouchFLO 3D interface
Level 2 – Quality purge – Recommended for best performance
Level 3 – Fundamental purge (time-consuming) – Reset non-responding tasks and services
Personally customized processes list – Select the processes you wish to close
Also you can find:
1. RAM status notification (in the end of the cleaning) (On/Off)
2. Restart Processes Mode (On/Off)
3. Show Hidden Processes (On/Off)

Changelog:
Version 1.0.4 – Fixed: about screen + small issue (nk.exe error msg) for htc touch pro users
Version 1.0.3 – Added: all registry settings is now in the archive/installation file (cab) + new icon for “cleanRAM config” shortcut (red)
Version 1.0.2 – Fixed: application shortcuts doesn’t appears (on some devices)
Version 1.0.1 – Fixed: some small issues with Level 1
Version 1.0.0 – Added: “Reset Processes Mode” new feature with restart time chooser
Version 0.9.5 – Added: “Show Hidden Processes” new feature to show all processes (including services. dangeros!)
Version 0.9.2 – Fixed: problem with “RAM Status Notification” screen and other small issues

What’s next:
1. Auto Schedule – I don’t know if this feature possible but I promise to check it
2. Custom mode: two different tables mode, one with restart applications and the other with kill applications
3. Solve some memory small issue (Level 3)
4. Fix the shortcut problem after install (Solved!)

Installation Instructions:
1. Download the attached .cab file from http://www.htcaddicts.com/?id=65.
2. Copy this file to some temporary folder in your device.
3. Execute it from your device (recommend you install to device memory).
* The cleanRAM will install into /Program files/htcAddicts.
* There is also a two links to “cleanRAM Config” (configuration tool) and “cleanRAM” (is the actual memory reclaimer) in the Start > Programs

Requirements:
HTC Touch Diamond/Pro with Microsoft Windows Mobile 6.1
Microsoft .NET Compact Framework 3.5

[Download .NET]
Use cleanRAM at your own risk!!! NO WARRANTY!!!

Download:
http://www.htcaddicts.com/?id=65
[Google Translated]

 

A big Thanks to www.htcAddicts.com for this awesome APP, it works flawlessly, I tried it on setting 1, it gave back 20MB of memory back!!!

 

Original Post can be found here: http://forum.xda-developers.com/showthread.php?t=487490


Mar 3 2009

Exchange 2007 Offline Address Book (OAB) keeps asking for authentication

If you are getting a constant authentication box pop up for your users when outlook is trying to connect to the Offline Address book, then read on, I am sure this will help you:

First thing is first make sure you have a vaild OAB

1. open Exchange Management console

2. open organization Configuration > Go to mailbox > choose Offline address book tab.

3. Make sure you have at least one address book here if not create one.

4. Right click on the address book go to properties > distribution Tab . ensure all boxes are ticked. > click on the ADD here you need to locate the appropriate server. > hit Ok.

5. You should be back to the OAB listings, if you have more then one that’s fine leave them for the time being, but choose the one you would like to be the default OAB and right click on it and choose ’set as default’

6. Now we need to update this OAB, right click on the default OAB you have created and then choose ‘update’

7. to ensure that the OAB has updated go to the event viewer and check the application log.

If you get a successful update great move on to step 9

if you get a warning with this event log below:

Log Name:      Application
Source:        MSExchangeSA
Date:          3/03/2009 9:10:24 AM
Event ID:      9320
Task Category: OAL Generator
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      server.domain.com.au
Description:
OALGen could not generate full details for some entries in the offline address list for address list ‘\Global Address List’.  To see which entries are affected, event logging for the offline address list generator must be set to at least medium.
- xxxxxxx Offline Address Book
Event Xml:
<Event xmlns="
http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="MSExchangeSA" />
    <EventID Qualifiers="32768">9320</EventID>
    <Level>3</Level>
    <Task>13</Task>
    <Keywords>0×80000000000000</Keywords>
    <TimeCreated SystemTime="2009-03-02T22:10:24.000Z" />
    <EventRecordID>14197</EventRecordID>
    <Channel>Application</Channel>
    <Computer>server.domain.com.au</Computer>
    <Security />
  </System>
  <EventData>
    <Data>\Global Address List</Data>
    <Data>xxxxxx Offline Address Book</Data>
  </EventData>
</Event>

 

You need to set the event logging a little higher to do this open up the exchange powershell console and run the below command:

Set-EventLogLevel -Identity "MSExchangeSA\OAL Generator" -Level Expert

Now repeat step 7

you should now have some errors

event ID: 9330 MSExchangeSA

OALGen encountered error 80040115 (internal ID 50004ef) accessing Active Directory servername for ”.
- /o=Elcom Technology Pty Ltd/cn=addrlists/cn=oabs/cn=xxxxxx Offline Address Book

 

and

Event ID 9334 MSExchangeSA

OALGen encountered error 80040115 while initializing the offline address list generation process. No offline address lists have been generated. Please check the event log for more information.
- /o=Elcom Technology Pty Ltd/cn=addrlists/cn=oabs/cn=xxxxx Offline Address Book

 

8. If these are the same kind of errors you must open ADSIedit (only included in the support package supplied by micorosft)

once you have installed the support tools

start > run > adsiedit.msc

go to

Using ADSIEdit:
1. Navigate to the ‘Default Global Address List’ object
CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=local
2. Go to the properties of the ‘Default Global Address List’ object
3. Copy the distinguishedName attribute of the ‘Default Global Address List’.
It should look similar to the one below.
CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=local
4. Navigate to the ‘Microsoft Exchange’ container.
CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=local
5. Go to properties of the ‘Microsoft Exchange’ container
6. Select the GlobalAddressList attribute and click Edit.
7. Paste in the distinguishedName attribute of the ‘Default Global Address List’ and click Add
8. Click OK twice to close out of the properties.
9. Replicate domain controllers
10. Rebuild the OAB again

above taken from http://forums.msexchange.org/m_1800488370/tm.htm

 

9. Check your permissions on your OAB go to c:\Program Files\Microsoft\Exchange Server\Client Access\OAB\ find the correct GUID that related to your OAB, right click on the GUID and then go to the security tab. Ensure that administrators and system have full control and authenticated users have only read access. (leave the other permissions)

—- you can use this command to find out

get-offlineaddressbook | fl > c:\OAB_Version.txt

 

10. Ensure that the OAB has populated with an XML file you can find this in :\Program Files\Microsoft\Exchange Server\Client Access\OAB\GUID_here\oab.XML.

If you have not got an XML file the OAB has not populated revist your event viewer.

 

11. Now in IIS you should have an OAB virtual directory if you do not you must create this use the below

New-OABVirtualDirectory -DomainController <Fqdn> -ExternalUrl <Url> -InternalUrl <Url> -Path <String> -PollInterval <Int32> -RequireSSL <$true | $false> -Server <ServerIdParameter> -WebSiteName <String>

more info here: http://technet.microsoft.com/en-us/library/aa996917.aspx

If you do already have the virtual directory Change that virtual directory to an application.

That’s it, everything should work now!

this took me 2 days to work out and all it really was, was that darn virtual directory set by MS as default.

I hope I save someone the pain and frustration I went through with solving this.


Feb 23 2009

Enable Pop on Exchange Server 2007

We have just finished our Exchange 2007 server migration and it went rather well, however there where a few  things that I thought I would share that had me stumped for a while.

So Exchange 07 doesn’t initialise Pop by default, while you will see all accounts will be enabled for Pop by default, but the pop service must be started

there are 2 ways of doing this

1. through the GUI

or

2. Through powershell

Seems like powershell is the best method, why? Simply because exchange 07 relies heavily on powershell so its a good place to familiarise yourself if you haven’t started already.

 

through the GUI

start > run type ’services.msc’ > find ‘Microsoft Exchange POP3′ and start this

You will also want to change it from manual to Automatic if you have server 08 you may also want to change this to auto (delayed start) I have done this as Pop is not as vital as other services on the exchange.

Through powershell – Exchange console (recommenced)

set-service msExchangePOP3 -startuptype automatic

start-service -service msExchangePOP3

 

No that should be about it, your ready to go that’s not so hard at all.

BUT if you have configured this and you are getting the authentication box constantly popup as if its not authenticating then your not finished read on:

First this is first go to the mailbox and ensure that the mailbox has POP enabled.

 

through the GUI

Recipient Configuration > Mailbox > find your mail box and then right click properties > Mailbox features you can enabled and disable here

 

Through Console

set-CASMailbox -Identity MailboxNameHere -popEnabled $true

 

If this is enabled then your authentication is set incorrectly.

"Under a default Exchange 2007 installation, IMAP and POP3 only work when the connection from the client is secured. For many organizations, this is not a desirable configuration."

We must allow for allow plain text logins

this can only be done as far as I know through the console using the below command

 

Set-PopSettings -LoginType PlainTextLogin

Now for this to take effect you must restart your ‘Microsoft Exchange POP3′ Service.

 

Now you can enjoy pop again.


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

http://technet.microsoft.com/en-us/library/bb125224.aspx

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

 

  1. setup /PrepareLegacyExchangePermissions: <domain name here>
    or
    setup /pl <domain name here>
  2. Setup /PrepareSchema
    or
    setup /ps
  3. Setup /PrepareAD [/OrganizationName: <organization name> ]
    or
    setup /p [/on:<organization name>]
  4. Setup /PrepareDomain
    or
    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:

http://www.microsoft.com/downloads/details.aspx?FamilyID=6be38633-7248-4532-929b-76e9c677e802&displaylang=en

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

  • MSTOUCH(UPDATE)
  • 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:

    http://forum.xda-developers.com/showthread.php?t=474406

    other phones

    http://forum.xda-developers.com/showthread.php?t=473884

    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
    Rotate,*,1,63,1,,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()
    '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
    objDoc.Close
     
    'Close Word
    objWord.Quit

    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")
    objSysInfo.RefreshSchemaCache
    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
    Else
    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")
    aFile.Delete
    Set AFile = objFSO.GetFile(Folderlocation&"Elcom.txt")
    aFile.Delete  
     
     
    '=========================================================
    ' 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 "
    objFile.Close
     
     
    Set objFile = objFSO.CreateTextFile(HTMFileString,True)
    objFile.Close
    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
    objFile.Close
     
     
    '==========================================================================
    ' 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()
    '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
    objDoc.Close
     
    'Close Word
    objWord.Quit
     
     
     
    ' ===========================
    ' 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 & _
    "\9375CFF0413111d3B88A00104B2A6676"
    objreg.EnumKey HKEY_CURRENT_USER, strKeyPath, _
    arrProfileKeys
    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
    Next
    Else
    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
    Else
    IsOutlookRunning = False
    End If
    Next
    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))
    Next
    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)
    Next
    StringToHex4 = strAll  
     
     
    End Function

    Enjoy