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
February 18, 2008
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
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... WendThen, when setting the registry keys :
And this worked perfectly for me
i’m actually still modifying the script for a finer use…
HTH,
Best regards,
Guillaume MAISON
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
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
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
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
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.
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 [...]
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/
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!
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 [...]
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.
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
July 31, 2008 at 6:28 am
Brad good one!
top idea.
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
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.
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.
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
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
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
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
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
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
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.)
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
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.
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
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
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.
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
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/
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!
November 21, 2008 at 1:58 am
Adrian,
Your most welcome.
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?
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