• Home
  • A Little about me

Brad Marsh’s Weblog

Bloggin about Microsoft, SQL Server, Windows Server 2008, Windows Mobile, new techie bits and pieces

February 18, 2008

AD Based Outlook Email Signature for 2003 and 2007 – MOVED

Posted by bradmarsh under Microsoft, Software, Techie
[34] Comments 

This article has now moved to:

http://bradmarsh.net/index.php/2008/02/18/ad-based-outlook-email-signature-for-2003-and-2007

NOTE: I have now posted a how to implement article on this topic find it here

http://bradmarsh.net/index.php/2008/05/14/ad-based-outlook-email-signature-for-2003-and-2007-continued/

 

34 Responses to “AD Based Outlook Email Signature for 2003 and 2007 – MOVED”

  1. Guillaume MAISON Says:

    February 20, 2008 at 1:56 pm

    Hi,

    i’ve found the same script… and i faced the same problem in a mixed environment…

    so i found the following solution to insert just before the LDAP stuf :

    
    'First, get the outlook main version
    '--------------------------------------------------
    Dim Outlook
    Dim OutlookVer
    set Outlook = createobject("outlook.application")
    OutlookVer = Left(Outlook.Version, InStr(Outlook.Version, ".")-1)
    if Err.Number0 then
            strMsg = CStr(Err.Number)& " - "& Err.Description
            MsgBox strMsg, vbExclamation, "Outlook"
           WScript.Quit
    End if
    set Outlook = Nothing
    
    ' As the rest of the script needs outlook to be closed,
    ' we do a small time-based loop (5 sec) to wait for Outlook to quit (5sec on my computer, check for the computers the script will be running)
    '----------------------------------------------------------------------------
    CheckTime = timer
    while (timer - checktime) < 5
            ' do nothing... just wait...
    Wend
    

    Then, when setting the registry keys :

    RegKey = “HKEY_CURRENT_USER\Software\Microsoft\Office\"&OutlookVer&".0\Common\General”
    

    And this worked perfectly for me :)

    i’m actually still modifying the script for a finer use…

    HTH,

    Best regards,

    Guillaume MAISON

    Reply
  2. bradmarsh Says:

    February 20, 2008 at 9:42 pm

    Cheers Seems to work well for me also.

    Only one problem with both scripts if trying on an account with muilpe accounts (not profiles email accounts) it dosent seem to set the signature as the default, whilst i can see it put the signature into outlook and when you go to your tool options and then signatures you can see it there, you have you click on APPLY, and then seems to work. But the problem is it needs manual intervention. I will be looking at this in the near future.
    Cheers

    Brad

    Reply
  3. Derrick Says:

    May 13, 2008 at 8:43 am

    this script is interesting, before i implement this, are there any preview how the output looks like after running this script?

    also, please assist me where to run this script, is it in the AD server?

    thanks

    Reply
  4. bradmarsh Says:

    May 13, 2008 at 10:43 am

    Hi Derrick,
    I dont know how I can show you how it works with out going into great detail, I can tell you you must pay attention to

    objfile.write “” & vbCrLf
    objfile.write “Microsoft Office Outlook Signature” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “ “& FullName & ” | “ & title & ” | “& Company & ” | Australian Technology Park ”& vbCrLf
    objfile.write “T +612 “ & PhoneNumber & ” | F +612 9209 4423 | http://www.elcom.com.au | ” & Email &” “ & vbCrLf
    objfile.write “
    ” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “ ” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write “” & vbCrLf
    objfile.write ” This email is intended for the intended recipients(s) and may contain confidential information. Reproduction, dissemination or distribution of this message is prohibited unless authorised by the sender. If you are not the intended recipient, please notify the sender immediately and you must not read, keep, use, disclose, copy or distribute this email without the sender’s prior permission. The views expressed by the sender are not necessarily those of Elcom Technology Pty Ltd” & vbCrLf
    objfile.write “” & vbCrLf
    objFile.Close

    this is where the HTML is written, as you can see this is specfic to where I work as you can see.
    You just need to change the signature to suit your requrements.

    As for the AD part yes you would typiclly run this on your AD server, I run this on the domain controllers, within the group policy I run this in the login scripts. I do this because we want our signatues to be forced to be standardized and this way if any one does change it the changes are overwitten at next login.

    If you stay tuned I will create another post tomorrow and out line everything i have listed above in more detail with screen shots.

    Cheers

    Reply
  5. Derrick Says:

    May 13, 2008 at 10:54 am

    Hi Brad, thanks for the fast reply. I’m about to implement this, but I’ll wait for your post tomorrow.

    Thanks in advance

    Regards

    Reply
  6. Derrick Says:

    May 14, 2008 at 3:17 am

    Hi Brad,

    I carefully follow the advise above, I integrate it in GPO as Logon Script, however an error appears during login like error in Line 1, etc etc.

    Reply
  7. AD Based Outlook Email Signature for 2003 and 2007 Continued « Brad Marsh’s Weblog Says:

    May 14, 2008 at 4:05 am

    [...] earlier on in the year I blogged about AD based signatures for 2003 and 2007 outlook (find the post here), It seems I am not the only person that needs this, I have been getting rather high stats on this [...]

    Reply
  8. bradmarsh Says:

    May 14, 2008 at 4:09 am

    Derrick find the new post here

    http://bradmarsh.wordpress.com/2008/05/14/ad-based-outlook-email-signature-for-2003-and-2007-continued/

    Reply
  9. bradmarsh Says:

    May 14, 2008 at 6:37 am

    Derrick,

    Have your tried running the file as a straight VBS file rather then intergrating it into AD? If so what where the results? If they were the same please send the script to gentex@tpg.com.au I will take a quick look this evening for you!

    Reply
  10. AD Based Outlook Email Signature for 2003 and 2007 Part 3 - Removing the Reply / forward signature « Brad Marsh’s Weblog Says:

    May 21, 2008 at 11:38 pm

    [...] you have run the original script previously  you will have find that just running the new script I am about to paste below is [...]

    Reply
  11. Toby Says:

    July 4, 2008 at 2:36 am

    Fantastic! This was exactly what was needed. Same ‘basic’ editing of the script and WALLA!
    Moving this further along, can this method be applied for OWA? I am doing some further checking on this and haven’t found anything yet but if you know something that could assist..? ;-)
    Thanks Again! Great work.

    Reply
  12. Brad Dunn Says:

    July 31, 2008 at 12:54 am

    Great article! We further modified this to exclude values if they are blank. E.g. if there is nothing listed for the Telephone, Fax & mobile, it will not show. This ensures unnecessary blank lines.


    Name
    Title
    Company Name

    A Address1
    Address2
    T xxx xxx xxx
    F xxx xxx xxx
    M xxx xxx xxx
    E
    name@domain.com.au


    Name
    Title
    Company Name

    A Address1
    Address2
    E
    name@domain.com.au

    A sample of how we did this for the fax is below (but it is the same for all fields):
    ‘Fax
    If LEN(FaxNumber) > 1 Then
    objfile.write “…F…” & FaxNumber & vbCrLf
    End If

    Reply
  13. bradmarsh Says:

    July 31, 2008 at 6:28 am

    Brad good one!
    top idea.

    Reply
  14. Johan Says:

    August 4, 2008 at 3:17 pm

    Hi Guys, brilliant articles. Do any of you know how to apply a .jpg as a signature through a Vbscript, or is there another way besides buying a 3rd party software

    Reply
  15. bradmarsh Says:

    August 4, 2008 at 10:18 pm

    Hi Johan,

    in this script I am actully appling 1 .JPG and 1 .gif image

    look at where the objfile.write starts and then work your way toward then end of the objfile.write and you will find images inserted using plan old HTML.

    Reply
  16. Brad Dunn Says:

    September 10, 2008 at 12:37 am

    Hi Brad,
    How have you overcome the problem of blank signatures when replying to Rich Text or Plain Text email messages? Composing new messages are fine… just replies are blank when the format isn’t HTML.

    Brad.

    Reply
  17. bradmarsh Says:

    September 10, 2008 at 12:25 pm

    Hi Brad,
    I have overcome this, the standard script should cater for this
    ‘Set AFile = objFSO.GetFile(Folderlocation&”Elcom.rtf”)
    aFile.Delete
    Set AFile = objFSO.GetFile(Folderlocation&”Elcom.txt”)
    aFile.Delete ‘

    as you can see it creates both a RTF and TXT, however I also have had problems with this notbeing created, primarly on a 07 outlook box. But in saything that I havent spent much time troubleshooting this as we dont use signatures in the reply / forward, so this never really pose an issue for us.

    However over the comming days if gets a little quiter I will see what I can do for you…
    Brad

    Reply
  18. Bjorn Says:

    October 8, 2008 at 6:40 am

    Hi,

    Great script, but I have a problem…When creating a new mail after implementing the signature file, the first mail is OK! But #2 reduses the size of the logo to a very small size. Restart Outlook – same result 1. = OK
    2. = small logo

    We are running Outlook 2007

    Regards, Bjorn

    Reply
  19. bradmarsh Says:

    October 9, 2008 at 12:15 am

    hi Bjorn,

    where is the image located? have you git t hosted on a server some where or embeddng it? have you giving the image spcific height and width within the HTML part?

    hope this helps
    Brad

    Reply
  20. Bjorn Says:

    October 9, 2008 at 5:34 pm

    I found out that the sollution was, as you described – to place the logo on our web server, not embedded.

    Bjorn

    Reply
  21. Bjorn Says:

    October 10, 2008 at 8:43 am

    Hi again,

    regarding the post prior to mine:

    “I have overcome this, the standard script should cater for this
    ‘Set AFile = objFSO.GetFile(Folderlocation&”Elcom.rtf”)
    aFile.Delete
    Set AFile = objFSO.GetFile(Folderlocation&”Elcom.txt”)
    aFile.Delete ‘

    as you can see it creates both a RTF and TXT, however I also have had problems with this notbeing created, primarly on a 07 outlook box.”

    The problem is that the *.rtf and *.txt is not created.
    Have you come up with a sollution?

    I have tried to create them in the script, but how do I get info into the files? This should be done automatically – right?

    Regards,
    Bjorn

    Reply
  22. bradmarsh Says:

    October 13, 2008 at 12:21 am

    Hi Bjorn,

    Your spot on it should create those 2 files, And i also have the same experiance with it not creating under 2007 / vista, I am yet to work this out. I just have not had the time. I will see what I can do over the comming week.

    Cheers
    Brad

    Reply
  23. Jonathan Says:

    October 20, 2008 at 7:02 pm

    Wow, thanks for the script. This is very helpful. One question though, I would like to have an abbreviated signature for replies. How could I extend this script to do that?

    Thanks again!

    (Also, I’m interested if you find a solution to the no signature problem when replying to RTF and TXT messages.)

    Reply
  24. bradmarsh Says:

    October 21, 2008 at 10:39 pm

    Hi Jonathan,

    Really havent had time too look at this rtf/txt issue and going awa on holidays for a little so onc I get back I should have a clear mind and should be able to nut it out for us all…

    as for your abbreviated you could modify the script, but you would be better off having 2 scripts with some modification
    remove referance to things like this objreg.SetBinaryValue HKEY_CURRENT_USER, _
    strsubkeypath, “New Signature”, myArray

    and the other one remove referance to

    objreg.SetBinaryValue HKEY_CURRENT_USER, _
    strsubkeypath, “Reply-Forward Signature”, myArray

    and change the HTML and the file names (obvoulsy cant have the same fine name)
    that should do it for you

    If you have run the orginal file then you will have to go to the registry and clean out where it has made its entrys, you find enough info on the 3 blogs I have made about this script.
    If you need mail me.
    Thanks

    Reply
  25. Jonathan Says:

    November 11, 2008 at 3:16 pm

    Thanks. I was able to set it up to use a separate signature for replies. It works great! (I just need to figure out how to get text replies.) :-)

    Also, I noticed that the state object from active directory was never called. Would this just be state=objuser.state …?

    Thanks again.

    Reply
  26. Jon Leach Says:

    November 18, 2008 at 4:38 pm

    Can this script be adapted for Outlook XP as well as 2003 and 2007. i have a mixed outlook for all versions.

    Cheers

    Reply
  27. bradmarsh Says:

    November 18, 2008 at 10:55 pm

    sure it could be used for XP, you would just need to find the corrasonding registry enties and add them

    Reply
  28. Adrian Says:

    November 19, 2008 at 7:03 am

    Brad, I am really keen to see whether you are able to resolve the reply to plain text email problem.

    We are running a mixed environment of XP/Outlook 2003 and Vista/2007. The script works flawlessly on Outlook 2003, but fails to create the .rtf and .txt files on Outlook 2007.

    I am almost ready to deploy this script across our network, and really this is the only flaw I can see to an exceptionally worked script.

    A pat on the back also for sharing your knowledge and continuing to assist others.

    Reply
  29. bradmarsh Says:

    November 19, 2008 at 9:06 am

    Hi Adrian,
    Thanks for the praise.

    Yes I know I have this same problem really need to put sometime aside for this. I promise I will try this over this week at some stage – things have been so hectic of late :(

    Reply
  30. bradmarsh Says:

    November 20, 2008 at 12:53 am

    Ok here is the fix for 07, not the best but it seems to work
    http://bradmarsh.wordpress.com/2008/11/20/ad-based-outlook-email-signature-for-2003-and-2007-part-4-now-writes-txt-and-rtf-as-well-as-html/

    Reply
  31. Adrian Says:

    November 20, 2008 at 12:32 pm

    Brad,

    I’ve taken the new code and propagated it through our network and it works brilliantly.

    Thanks for the assistance!

    Reply
  32. bradmarsh Says:

    November 21, 2008 at 1:58 am

    Adrian,

    Your most welcome. :)

    Reply
  33. P Dirks Says:

    January 19, 2009 at 4:21 pm

    The Script works super,thanx for creating
    like many

    i got 1 question,is the following possible

    if a user wants to make some minor changes if needed,example: he wants his mobile phone mentioned,and don’t needs to be overwritten by the same script again,
    until i make some major changes and call it out by version eg
    Call SetDefaultSignature(“Elcom-v101″,”")
    and after a big change
    Call SetDefaultSignature(“Elcom-v102″,”")

    is this possible?
    and if so how?

    Reply
  34. bradmarsh Says:

    January 19, 2009 at 9:12 pm

    from the script provided there is no way you could do this, however you could extend it with a few if statments and a check, at the top of the script you could so something like
    if file. html exsits exit and then when you want to overwrite the code with new one comment the if statments.

    Please for any future replies post them at http://bradmarsh.net/index.php/2008/02/18/ad-based-outlook-email-signature-for-2003-and-2007/
    Thanks

    Reply

Leave a Reply

Click here to cancel reply.

Archived Entry

  • Post Date :
  • February 18, 2008 at 9:05 am
  • Category :
  • Microsoft, Software, Techie
  • Do More :
  • You can leave a response, or trackback from your own site.

Blog at WordPress.com. — Theme: Connections by www.vanillamist.com