Home > Windows > Script: Auto-generate Outlook Signature

Script: Auto-generate Outlook Signature

Wednesday, October 31, 2007 Leave a comment Go to comments

If you’re managing a large number of users, you might sometimes have to create Outlook signatures for these users. Doing this manually can be a right pain in the arse, so I decided to write a quick script which, when executed (HINT: set it to run at logon in Group Policy), will automatically create a signature called ‘Default’ for Outlook 2003 and up to use. Disclaimer: I’ve only tested it on Outlook 2003 and Outlook 2007 running on a domain so if it doesn’t work, sorry…

Oh and yes, I am aware there are server-side and ASP products that can do this – however the only free product I’ve tried (GFI’s Mail Essentials) had a nasty habit of crashing our Exchange 2003 Server.


Set objUser = CreateObject("WScript.Network")
userName = objUser.UserName
domainName = objUser.UserDomain

FUNCTION GetUserDN(BYVAL UN, BYVAL DN)
Set ObjTrans = CreateObject("NameTranslate")
objTrans.init 1, DN
objTrans.set 3, DN & "\" & UN
strUserDN = objTrans.Get(1)
GetUserDN = strUserDN
END FUNCTION

Set objLDAPUser = GetObject("LDAP://" & GetUserDN(userName,domainName))

'Prepare to create some files
Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile,
plainTextFilePath, richTextFile, richTextFilePath, htmlFile,
htmlFilePath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWsh = CreateObject("WScript.Shell")
appDataPath = objWsh.ExpandEnvironmentStrings("%APPDATA%")
pathToCopyTo = appDataPath & "\Microsoft\Signatures\"

'Let's create the plain text signature
plainTextFilePath = pathToCopyTo & "Default.txt"
Set plainTextFile = objFSO.CreateTextFile(plainTextFilePath, TRUE)
plainTextFile.WriteLine("-- ")
plainTextFile.WriteLine(objLDAPUser.DisplayName)
plainTextFile.WriteLine(objLDAPUser.title)
plainTextFile.WriteLine(objLDAPUser.company)
plainTextFile.WriteLine("t: " & objLDAPUser.telephoneNumber)
plainTextFile.WriteLine("f: " & objLDAPUser.facsimileTelephoneNumber)
plainTextFile.WriteLine("e: " & objLDAPUser.mail)
plainTextFile.Write("w: " & objLDAPUser.wWWHomePage)
plainTextFile.Close

'Now we create the Rich Text signature
richTextFilePath = pathToCopyTo & "Default.rtf"
Set richTextFile = objFSO.CreateTextFile(richTextFilePath, TRUE)
richTextFile.WriteLine("{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0
Arial;}}")
richTextFile.WriteLine("\viewkind4\uc1\pard\f0\fs20 -- \par")
richTextFile.WriteLine(objLDAPUser.DisplayName & "\par")
richTextFile.WriteLine(objLDAPUser.title & "\par")
richTextFile.WriteLine(objLDAPUser.company & "\par")
richTextFile.WriteLine("t: " & objLDAPUser.telephoneNumber & "\par")
richTextFile.WriteLine("f: " & objLDAPUser.facsimileTelephoneNumber & "\par")
richTextFile.WriteLine("e: " & objLDAPUser.mail & "\par")
richTextFile.WriteLine("w: " & objLDAPUser.wWWHomePage & "\par")
richTextFile.Write("}")
richTextFile.Close

'And finally, the HTML signature
htmlFilePath = pathToCopyTo & "Default.htm"
Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
htmlfile.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0
Transitional//EN""
""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
htmlfile.WriteLine("<html xmlns=""http://www.w3.org/1999/xhtml"" >")
htmlfile.WriteLine("<body>")
htmlfile.WriteLine("<div style=""font-size:10pt;
font-family:'Arial','helvetica';"">")
htmlfile.WriteLine("<div>-- </div>")
htmlfile.WriteLine("<div>" & objLDAPUser.DisplayName & "</div>")
htmlfile.WriteLine("<div>" & objLDAPUser.title & "</div>")
htmlfile.WriteLine("<div>" & objLDAPUser.company & "</div>")
htmlfile.WriteLine("<div>t: " & objLDAPUser.telephoneNumber & "</div>")
htmlfile.WriteLine("<div>f: " & objLDAPUser.facsimileTelephoneNumber & "</div>")
htmlfile.WriteLine("<div>e: <a href="" & objLDAPUser.mail & "">" &
objLDAPUser.mail & "</a></div>")
htmlfile.WriteLine("<div>w: <a href=""http://" &
objLDAPUser.wWWHomePage & """>" & objLDAPUser.wWWHomePage &
"</a></div>")
htmlfile.WriteLine("</div>")
htmlfile.WriteLine("</body>")
htmlfile.Write("</html>")
Advertisement
  1. noizychild
    Tuesday, November 27, 2007 at 5:02 pm | #1

    When I execute it I receive an error,
    Expected identifier
    Line:16
    Char:62

  2. Rob
    Friday, November 30, 2007 at 5:00 pm | #2

    Ah… there are a few lines which, thanks to my stylesheet, are broken across several lines when they should be on one. Line breaks are very important to VBScript!

    Please go here to download the script in its working format.

    Rob

  3. Ray Ortiz
    Monday, January 28, 2008 at 1:16 pm | #3

    Great script. I have one question. Rather than displaying t, f, e and w can it display, telephone, fax, email, website.
    Thanks!

  4. Woter
    Thursday, January 31, 2008 at 1:05 pm | #4

    Ray,

    Yes. Just change t, f, e & w to telephone, fax, email & web. You can display anything you like inside the ” “. It’s a string.

    HTH

    Woter

  5. Jason
    Thursday, February 14, 2008 at 6:24 pm | #5

    What exactly do I do with this file? Have it run with each individual logon? Sorry, I’m not very experienced with scripts.

  6. al
    Wednesday, July 2, 2008 at 10:01 am | #6

    Thanks Rob, thats exactly what I have been looking for! :-)

    I would like to insert a company logo, could you point me in the right direction please?

    Thanks again!

    Al

  7. Rob
    Thursday, July 17, 2008 at 10:05 pm | #7

    Hmm, that could be a lot more tricky. It should be pretty simple to do as a web link to an image hosted on a web site – just stick a line towards the end that says:

    htmlfile.WriteLine(“<div><img src=”http://your_image_path” /></div>”)

    If you’re trying to actually embed an image in the message however, you’d need to look at how Outlook does this internally. From memory it’s encoded as a binary MIME part; I’d suggest looking on the MSDN site if this is something you’d really want to do.

  8. vengadesh
    Tuesday, July 29, 2008 at 9:05 am | #8

    Hi

    This is really good and thanks very much for providing this.

    Do u have any scripts for configuring Outlook profile?

  9. Steven
    Tuesday, August 12, 2008 at 1:57 pm | #9

    Hi

    Sorry if I’m being dim but how do you execute this? I’ve saving as a bat file and running it but I get an error on every line

  10. Steven
    Tuesday, August 12, 2008 at 3:54 pm | #10

    Sorry, ignore my last comment, I was being dim lol.

    One other question, how would I specify the font, size, and style of the rich text? I have searched the internet tirelessly for about an hour and a half and I can’t seem to find an answer.

    On our network all emails are either rich text or plain text (if sent or replied from a blackberry).

  11. Rob
    Tuesday, August 26, 2008 at 12:06 pm | #11

    Hi Steven,

    I’ve had a quick look at the RTF fonts thing. If you find the line that says:

    {\fonttbl{\f0\fswiss\fcharset0 Arial;}}
    You can extend this like so:

    {\fonttbl{\f0\fswiss\fcharset0 Arial;}{\f1\fswiss\fcharset1 FONT NAME HERE;}}

    You could add as many fonts as you liked (incrementing the "fx" each time). Then, wherever you want to use your new font, precede the line with \fx, as so:

    \f0 this text is in font f0, \f1 and this text will be in font f1

    I hope this makes sense!

    Rob

  12. Jamie
    Wednesday, October 8, 2008 at 2:09 pm | #12

    Works great but how do you tell Outlook to use the Default signature for New messages and Replies/Forwards? It created it just fine but didn’t set it as the signature to use. I need that code if you know it.

  13. Yoganand
    Friday, November 14, 2008 at 3:46 am | #13

    Hi
    That’s and excellent script!!!
    Here we have all auto generated mails. How to add signature with an Image on this?
    Is there any settings in Outlook or to go for Outlook macro.
    Guide me please, little bit an urgent assignment.

    Regards
    Yoganand

  14. Enrico
    Thursday, November 20, 2008 at 2:53 pm | #14

    Great script man! Can you help me in a small problem? I don’t know how to insert empty lines… i’m a script newbie :(
    I tried with htmlfile.writeline, but also writeblanklines but with no result…

  15. Enrico
    Thursday, November 20, 2008 at 3:54 pm | #15

    Fixed =) One of my collegues was a good html programmer… the solution is use the br tag.

    So… now only one question: the signature is created but not loaded automatically. How can i do this, if i can do this?

  16. Thursday, December 4, 2008 at 8:42 pm | #16

    For those of you who want to set this automatically (Which, if you’re going to script it as a GPO, you will definitely want to) this is the solution, it may sound a bit silly, but hey, it’s VBS :)

    You have create a Word object. For some reason, Microsoft have put all of the signature apis into Word, rather than Outlook. Just put in the following code:

    Set objWord = CreateObject(“Word.Application”)
    objWord.Visible = false
    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature
    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
    objSignatureObject.NewMessageSignature = “Default”

    Change “Default” to the name of the file, if you have changed it.

    I personally dislike full sized signatures in reply emails, so one extra thing I have done, is modified the above script (That you very much for that by the way, I didn’t realise you could use HTML, makes life so much easier.. I just have to figure out how to embed images now) to create two seperate files, one for new emails, and one for replies, and added the following line to my little snippet above:

    objSignatureObject.ReplyMessageSignature = “Default – Reply”

    Just copy and paste the “Now we create the Rich Text signature” and “And finally, the HTML signature” – changing the “Default.htm” and “Default.rtf” to “Default – Reply.htm” and “Default – Reply.rtf” and you’ll be set.

  17. Ian
    Tuesday, December 23, 2008 at 4:08 pm | #17

    There is some automated mail signature software out there called: Symprex Mail Signature Manager, it works with rtf, txt and html. Its very flexible, intregates into AD, pulling all it’s info from AD.

    We have have used it for approx 6 months, allowing us to have standardised email signatures across our AD domain.

  18. Nuno Presley
    Wednesday, January 28, 2009 at 5:56 pm | #18

    Hi there,

    This script would be very handy since I have to configure almost 150 signatures in a client company. They have several offices in several different cities so the solution would be to run something on each computer to generate the individual signature. Can this script be run in each Outlook client? Can anyone please explain how can we run this script, as many other users also have this doubt?
    Thanks.

  19. Rob
    Sunday, March 15, 2009 at 2:23 pm | #19

    Hi Nuno,

    The way I did it was via Group Policy. Create a GP object, open the scripts section, browse to the folder that is created for that GP for scripts, copy the .VBS file into this directory and link the GP to it. It’ll then run on every machine that gets the group policy applied to it.

    Hope this helps,

    Rob

  20. sysadmin
    Friday, April 10, 2009 at 4:03 pm | #20

    [quote]
    For those of you who want to set this automatically (Which, if you’re going to script it as a GPO, you will definitely want to) this is the solution, it may sound a bit silly, but hey, it’s VBS :)

    You have create a Word object. For some reason, Microsoft have put all of the signature apis into Word, rather than Outlook. Just put in the following code:

    Set objWord = CreateObject(”Word.Application”)
    objWord.Visible = false
    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature
    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
    objSignatureObject.NewMessageSignature = “Default”

    Change “Default” to the name of the file, if you have changed it.

    I personally dislike full sized signatures in reply emails, so one extra thing I have done, is modified the above script (That you very much for that by the way, I didn’t realise you could use HTML, makes life so much easier.. I just have to figure out how to embed images now) to create two seperate files, one for new emails, and one for replies, and added the following line to my little snippet above:

    objSignatureObject.ReplyMessageSignature = “Default – Reply”

    Just copy and paste the “Now we create the Rich Text signature” and “And finally, the HTML signature” – changing the “Default.htm” and “Default.rtf” to “Default – Reply.htm” and “Default – Reply.rtf” and you’ll be set.
    [/quote]

    I couldnt get this to work for me. I even declared the new variables. I can choose the signature but it doesnt automatically make it the default for new msgs or replies. Is it still working for you?

  21. Monday, June 29, 2009 at 1:33 pm | #21

    Thanks a lot for sharing this, going to be testing it out and hopefully using it in our domain very soon :)

  22. Justin
    Monday, July 20, 2009 at 7:31 pm | #22

    If you need to set the default signature, and dont have Word installed on all your systems you can create a registry key that will set the default signatures.

    Dim objWSHShell
    Dim objWSHNetwork
    Dim objLDAPUser

    Dim strRegKey
    Dim strNewSignature
    Dim strReplySignature

    Set objWSHShell = CreateObject(“WScript.Shell”)
    Set objWSHNetwork = CreateObject(“WScript.Network”)
    Set objLDAPUser = GetObject(“LDAP://” & GetUserDN(objWSHNetwork.UserName,objWSHNetwork.UserDomain))

    strDisplayName = objLDAPUser.DisplayName

    strRegKey = “HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\”
    strNewSignature = strDisplayName
    strReplySignature = strDisplayName & ” Reply”

    FUNCTION GetUserDN(BYVAL UN, BYVAL DN)
    Set ObjTrans = CreateObject(“NameTranslate”)
    objTrans.init 1, DN
    objTrans.set 3, DN & “\” & UN
    strUserDN = objTrans.Get(1)
    GetUserDN = strUserDN
    END FUNCTION

    objWSHShell.RegWrite strRegkey & “NewSignature”, strNewSignature , “REG_SZ”
    objWSHShell.RegWrite strRegkey & “ReplySignature”, strReplySignature , “REG_SZ”

  23. Tuesday, July 21, 2009 at 1:39 pm | #23

    I have had the GPO script working for some time now, but I CANNOT get a picture to embed (via link). We would like our company logo inserted but I can’t seem to make it happen. Not sure if it’s a limitation in Outlook 2007 or what. You original code for inserting an image errored on the tags. I removed them and the script runs without error, but still does not place the picture in the message. ANY help is appreciated. I’ve been Googling for 2 days now.

    Current code for the image that doesn’t bomb, but doesn’t do anything either.
    htmlfile.WriteLine(“”) [/CODE]

  24. typhoon43
    Tuesday, July 21, 2009 at 1:42 pm | #24

    Not sure what happened up there with the code. Again, I am using

    htmlfile.WriteLine(” img src=”www.ourcompany.com./logo.jpg” />”)

    to set the image. No errors, but it does not render at all.

    < taken out before img src because it kept trying to run the code in this post.

  25. Rob
    Sunday, July 26, 2009 at 6:43 pm | #25

    Hi,

    If you’re using “img src=”… the first ” will close the string file and ruin your HTML. For that line you should change it to something like this:

    htmlfile.WriteLine(“img src=”"”http://www.ourcompany.com/logo.jpg”"” />”)

    Hope this helps!

    Rob

  26. karla
    Tuesday, August 11, 2009 at 3:32 pm | #26

    Helllo, thank you for the script, i How a question, how can I integrate the script for webmail , to the users that dont have outlook configure,

    Thank you

  27. Rob
    Wednesday, August 12, 2009 at 3:20 pm | #27

    Unfortunately this is a client-only script, specifically for the Outlook client.

    For webmail – OWA – I doubt very much it’s that straightforward as would probably require some custom ASPX forms in the OWA installation.

  28. Yogesh
    Monday, August 17, 2009 at 3:14 pm | #28

    Hello All,

    I am also using the same script for auto signature but we are facing an issue from a quite long time now- users reported that when they login , they have the autosignature in outlook by defualt but after sometime they disappear of its own and they have to select it again form signature drop down menu.

    I have pushed this vbs via group policy.

    Please let me know wht can be done :(

  29. Friday, September 25, 2009 at 5:33 pm | #29

    There are no questions.
    Simply I wish to tell many thanks.
    Magnificent work.

  30. Lee
    Wednesday, September 30, 2009 at 3:54 pm | #30

    Can you use windows variables within this script? i.e %username%

    I am presuming that you can

  31. Sjouke
    Tuesday, November 3, 2009 at 2:12 pm | #31

    Thanks guys, by creating the script at my work my boss likes me because I saved € 1500,- :-)

    But if anyone knows how to do it by OWA it would be perfect!

  32. Richard
    Tuesday, November 10, 2009 at 4:06 pm | #32

    For some reason I get the following error when running the basic script on a useraccount from a Active Directory policy:

    permission denied: ‘createobject’ code 800A0046

    Spent most of the day figuring this one out, still no clue…
    Anyone want to share thoughts on this on? Thanx in advance!!

    The script looks like this:

    Set objUser = CreateObject(“WScript.Network”)
    userName = objUser.UserName
    domainName = objUser.UserDomain

    FUNCTION GetUserDN(BYVAL UN, BYVAL DN)
    Set ObjTrans = CreateObject(“NameTranslate”)
    objTrans.init 1, DN
    objTrans.set 3, DN & “\” & UN
    strUserDN = objTrans.Get(1)
    GetUserDN = strUserDN
    END FUNCTION

    Set objLDAPUser = GetObject(“LDAP://” & GetUserDN(userName,domainName))

    ‘Prepare to create some files
    Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile, plainTextFilePath, richTextFile, richTextFilePath, htmlFile, htmlFilePath
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)
    Set objWsh = CreateObject(“WScript.Shell”)
    appDataPath = objWsh.ExpandEnvironmentStrings(“%APPDATA%”)
    pathToCopyTo = appDataPath & “\Microsoft\Signatures\”

    ‘Create the plain text signature
    plainTextFilePath = pathToCopyTo & “Default.txt”
    Set plainTextFile = objFSO.CreateTextFile(plainTextFilePath, TRUE)
    plainTextFile.WriteLine(objLDAPUser.DisplayName)
    plainTextFile.WriteLine(objLDAPUser.title)
    plainTextFile.WriteLine(“”)
    plainTextFile.WriteLine(objLDAPUser.company)
    plainTextFile.WriteLine(“”)
    plainTextFile.WriteLine(“tel: ” & objLDAPUser.telephoneNumber)
    plainTextFile.WriteLine(“fax: ” & objLDAPUser.facsimileTelephoneNumber)
    plainTextFile.WriteLine(“mob: ” & objLDAPUser.mobile)
    plainTextFile.WriteLine(“”)
    plainTextFile.Write(objLDAPUser.wWWHomePage)
    plainTextFile.WriteLine(“”)
    plainTextFile.Close

    ‘Create the Rich Text signature
    richTextFilePath = pathToCopyTo & “Default.rtf”
    Set richTextFile = objFSO.CreateTextFile(richTextFilePath, TRUE)
    richTextFile.WriteLine(“{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0 Arial;}}”)
    richTextFile.WriteLine(“\viewkind4\uc1\pard\f0\fs20 \par”)
    richTextFile.WriteLine(objLDAPUser.DisplayName & “\par”)
    richTextFile.WriteLine(objLDAPUser.title & “\par”)
    richTextFile.WriteLine(“\par”)
    richTextFile.WriteLine(objLDAPUser.company & “\par”)
    richTextFile.WriteLine(“\par”)
    richTextFile.WriteLine(“tel: ” & objLDAPUser.telephoneNumber & “\par”)
    richTextFile.WriteLine(“fax: ” & objLDAPUser.facsimileTelephoneNumber & “\par”)
    richTextFile.WriteLine(“mob: ” & objLDAPUser.mobile & “\par”)
    richTextFile.WriteLine(“\par”)
    richTextFile.WriteLine(objLDAPUser.wWWHomePage & “\par”)
    richTextFile.WriteLine(“\par”)
    richTextFile.Write(“}”)
    richTextFile.Close

    ‘Create the HTML signature
    htmlFilePath = pathToCopyTo & “Default.htm”
    Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“” & objLDAPUser.DisplayName & “”)
    htmlfile.WriteLine(“” & objLDAPUser.title & “”)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“tel: ” & objLDAPUser.telephoneNumber & “”)
    htmlfile.WriteLine(“fax: ” & objLDAPUser.facsimileTelephoneNumber & “”)
    htmlfile.WriteLine(“mob: ” & objLDAPUser.mobile & “”)
    htmlfile.WriteLine(“” & objLDAPUser.wWWHomePage & ““)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“”)
    htmlfile.Write(“”)

  33. Chris
    Monday, November 23, 2009 at 10:20 am | #33

    Hi all,

    First of all, I would like to thank the author for this script. It’s very good. In combination with some registry manipulation it’s quite powerful.

    for me, there is only one question left. Since our firm’s signature is based on HTML, I would like to set Outlook’s Mail Format to HTML by default. Any idea where the proper registry entry looks can be found?

  34. CP
    Thursday, February 4, 2010 at 10:17 am | #34

    Hi, Great work on the script. Im a newb to this too but i have 1 more Q. I have 100 computer on the domain using outlook 2003 and signautres configured. Do you have a script that could run automatically for just 1 line of the signature which changes every 3 months. its really a pain to go edit all of these at once. Thanks again. really will appreciate the help.

  35. Mark
    Thursday, February 11, 2010 at 10:03 am | #35

    hi Rob,

    this script works great on both rich text and plain, but i cant seem to get it working on html. I have done exaclty what you have.

    could i have some advice?

    Many thanks

  36. Wednesday, March 3, 2010 at 8:34 pm | #36

    Hi Rob,

    please tell me about process for this script. I copied all codes and save into the stagging server but when I tried with same script then Its prompt “Run time error: Path not found” and same has been done into the XP machine with out member server machine “C:\WINDOWS\system32>cscript.exe //nologo sign.vbs
    C:\WINDOWS\system32\sign.vbs(7, 1) (null): The specified domain either does not
    exist or could not be contacted.”

    Could you provide me steps to run this scripts. I just have little knowledge for script.

    I really don’t know to how to run or where I need to keep this script and again how to run?

    Could u help me?

    Many Thanks ,
    Simon D

  37. xiglet
    Tuesday, March 30, 2010 at 10:16 am | #37

    Hi

    Looks just like what I’m looking for. However, I get this error:
    Line: 24
    Char: 1
    Error: Path not found
    Code: 800A004C
    Source: Microsoft VBScript runtime error.

    Any idea what causes this? I’m using a Windows7 client so I guessed the appdatapath could be wrong, but I get the same error on a Windows 2008 server.

    best regards
    xiglet

  38. Mark C
    Thursday, April 8, 2010 at 7:31 pm | #38

    Great script, thanks for creating this is at saved me many hours! One question, what is the proper syntax for the richtextfile if I wanted to have a line of text at the bottom in BOLD and with a font size of 7.5?

    Thanks!

  39. Saturday, July 10, 2010 at 1:02 pm | #39

    Just to let you know, if you are not a developer/scripting wiz and want to do something like this for your user community, we have a low cost multi language compliant tool that you could consider, it also syncs with blackberry server as well.. Check it out here

    http://www.iphelion.com/Product/SignatureCreator.aspx

    Thanks
    Andy

  40. Tuesday, July 27, 2010 at 10:07 pm | #40

    This script is great.
    Great job to those who made it!

  41. William
    Tuesday, August 3, 2010 at 9:20 pm | #41

    Great script and been working for a year or so now – but just recently 2 machines started getting “object does not support automation” error when running the script from gpo. It points to the following line:

    objSignatureObject.NewMessageSignature = “Default”

    anyone have any ideas?

    the two workstations are running different versions of office (2007 and 2003)

    TIA

    William

  42. Sunday, October 3, 2010 at 4:19 pm | #42

    Awesome piece of work, thank you!

  43. Gilles
    Thursday, December 2, 2010 at 10:03 am | #43

    Excellent !! Thanks…

  44. Gene
    Thursday, December 16, 2010 at 8:47 pm | #44

    Hi,
    I am having issues with editing the html portion of this script to force bold, italics, and spaces between items .

  45. ray
    Wednesday, January 12, 2011 at 8:05 pm | #45

    htmlfile.WriteLine(“”)

    I get this error for that line only:

    Line: 69
    Char: 33
    Error: Expected ‘)’
    Code: 800A03EE
    Source: MS VBScript compilation error

    What am I doing wrong? I have the script and the picture saved on my desktop.. not in seperate folders.

  46. Mat
    Wednesday, March 2, 2011 at 2:50 pm | #46

    I’ve been using this script for over a year — it’s brilliant. I’ve created a GPO that runs it at logon and it’s been working perfectly, however, I’ve noticed it doesn’t work for my Windows 7-based machines at logon (but I can run it manually on Windows 7 and it works).

    Don’t suppose anyone can think of a reason why?

  47. Thursday, May 5, 2011 at 3:57 pm | #47

    I want to have different company logos based on the company name (Our company has several parts to it that are unique businesses under one corporate name) in ad. The attribute name is objLDAPUser.company. I was thinking of using If Then Else statements, but want to know how I’d add them in. Any pointers?

    This is just to do text output, but will replace that with img source html tags once I get this part working.

    if objLDAPUser.company = ‘Internal Services’ Then
    htmlfile.WriteLine(‘Internal Services’) ElseIf
    objLDAPUser.company = ‘Finance’ Then
    htmlfile.WriteLine(‘Finance’) EndIf

  48. Tuesday, June 14, 2011 at 10:52 am | #48

    You are by far a legend. You have saved us a lot of work!

    Thank you!

  49. Des
    Saturday, July 9, 2011 at 1:20 am | #49

    Rob Great script
    Thanks heaps for sharing this has saved me many hours/potential typos
    Thanks to the other contributors as well

    xiglet
    “Looks just like what I’m looking for. However, I get this error:
    Line: 24
    Char: 1
    Error: Path not found
    Code: 800A004C
    Source: Microsoft VBScript runtime error. ”

    This is because the Signarures folder is not there by default if a signature has not been configured as yet
    Maybe someone can add a bit to the top of the script to check for and create the Signatures folder if is not already there

    If it helps anyone I had to add 2 x graphics to the bottom sourced from and linked to a website, details have been changed

    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(” “)
    htmlfile.WriteLine(” “)
    htmlfile.WriteLine(” “)
    htmlfile.WriteLine(” “)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“”)
    htmlfile.WriteLine(“”)
    htmlfile.Write(“”)

    Des

  50. Greg
    Tuesday, August 16, 2011 at 9:48 am | #50

    Rob,
    I have created vbscipt similar to above for outlook signature. However I have a htm file with a letterhead stationary template. how would I go about writing script to set this within outlook 2003? Any help would be great

  51. Nassoro
    Thursday, November 17, 2011 at 5:54 pm | #51

    Hi All,

    I need help to create auto reply to my office “help desk email”.
    I want auto reply to happen between 5:01pm to 8:00 am then switched off during working hours *8:01am to 5:00pm everyday.

    Thanks

  1. Monday, July 20, 2009 at 9:16 pm | #1
  2. Monday, March 7, 2011 at 10:10 pm | #2

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s