Techtips, hints and guides, from all areas of Technology, IT, Computers, as well as any and all hard to find and useful information. If your looking for the best tips this is the place to find it...

How to Setup Email Signature with logon script.

This is a simple how to on ensuring your users email signatures are all standard (Under your Control) its a small vb script that defines variables from the active directory then uses a macro style operation to generate the signature.

Here is the script.

—————————————————————————————————-

On Error Resume Next

Set objSysInfo = CreateObject(“ADSystemInfo”)

Set WshShell = CreateObject(“WScript.Shell”)

strUser = objSysInfo.UserName
Set objUser = GetObject(“LDAP://” & strUser)

strName = objUser.FirstName & ” ” & objUser.LastName
strTitle = objUser.Description
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strOtherPhone = objUser.otherTelephone
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strPostal = objUser.PostOfficeBox
‘=====================================
‘ Full Signature.
‘=====================================

Set objWord = CreateObject(“Word.Application”)

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.Font.Name = “Arial”
objSelection.Font.Size = 10
objSelection.Font.Bold = true
objSelection.TypeText Ucase(strName) & Chr(11)
objSelection.Font.Bold = false
objSelection.Font.Italic = true
objSelection.TypeText strTitle & Chr(11)
objSelection.Font.Italic = false
objSelection.TypeText Chr(11)
objSelection.Font.Bold = true
objSelection.TypeText “Mobile: ”
objSelection.Font.Bold = false
objSelection.TypeText strMobile & Chr(11)
objSelection.Font.Bold = true
objSelection.TypeText “Direct: ”
objSelection.Font.Bold = false
objSelection.TypeText strOtherPhone & Chr(11)
objSelection.Font.Bold = true
objSelection.TypeText “Email: ”
objSelection.Font.Bold = false
objSelection.Hyperlinks.Add objSelection.range, “mailto:” & strEmail, , , strEmail & Chr(11)
objSelection.Font.Bold = true
objSelection.TypeText “Street: ”
objSelection.Font.Bold = false
objSelection.TypeText strStreet & ” ” & strLocation & ” ” & strPostCode & Chr(11)
objSelection.Font.Bold = true
objSelection.TypeText “Postal: ”
objSelection.Font.Bold = false
objSelection.TypeText strPostal & Chr(11)
objSelection.InlineShapes.AddPicture “\\server\signature.jpg”
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.Font.Size = 7
objSelection.Font.Bold = false
objSelection.Font.Italic = true
objSelection.TypeText “The information contained in this transmission including any attached documentation is privileged and confidential. It is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this communication in error, please notify your Administrator immediately by replying to this email. Please delete all copies of this message and any attachments immediately.”
objSelection.TypeText Chr(11)
objSelection.Font.Italic = false
objSelection.Font.Name = “Webdings”
objSelection.Font.Size = “15″
objSelection.Font.Color = RGB(115,155,63)
objSelection.TypeText “P ”
objSelection.Font.Name = “Calibri”
objSelection.Font.Size = “10″
objSelection.TypeText “Please consider the environment before printing this e-mail.”
Set objSelection = objDoc.Range()

objSignatureEntries.Add “Full Signature”, objSelection
objSignatureObject.NewMessageSignature = “Full Signature”

objDoc.Saved = True
objWord.Quit
‘=====================================
‘ Reply Signature
‘=====================================

Set objWord = CreateObject(“Word.Application”)

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.Font.Name = “Arial”
objSelection.Font.Size = 10
objSelection.Font.Bold = true
objSelection.TypeText Ucase(strName) & Chr(11)
objSelection.Font.Bold = false
objSelection.Font.Italic = true
objSelection.TypeText strTitle & Chr(11)
objSelection.Font.Italic = false
objSelection.TypeText Chr(11)
objSelection.TypeText “Mobile: ” & strMobile & Chr(11)
objSelection.TypeText “Email: ” & strEmail

Set objSelection = objDoc.Range()

objSignatureEntries.Add “Reply Signature”, objSelection

objSignatureObject.ReplyMessageSignature = “Reply Signature”

objDoc.Saved = True
objWord.Quit

——————————————————————————————————————–

The Script its self is pretty rudimentary, Where objects are defined and then “typed” into the signature.
Remember you AD needs to be up to date as all the values are called from the fields in Active Directory. To install and use simply copy and paste the script and paste it into notepad save it as Signature.vbs then add it to your logon script “wscript \\server\SYSVOL\domain.local\scripts\signature.vbs” or add it to the logon/logoff fields in Group Policies if you need to remove a line simply comment it out with a ‘ that way if you need to use it again you dont have to search the earth for the correct wording.

Here are some of the additions to the script:

Insert another line – Chr(11)
Add an Image to the signature - objSelection.InlineShapes.AddPicture “\\server\signature.jpg”
Add Text - objSelection.TypeText “Message footer or Privacy Statement.”

Incoming search terms:

How to Setup Email Signature with logon script.
0 votes, 0.00 avg. rating (0% score)


Posted: March 22nd, 2011 | Author: | Filed under: Tips & Tricks | Tags: , , | 3 Comments »

3 Comments on “How to Setup Email Signature with logon script.”

  1. 1 dog said at 8:17 am on May 5th, 2011:

    [...] techtips.co.za | Tech tips, hints, guides, gadgets [...]

  2. 2 asian massage in minneapolis said at 9:24 pm on July 7th, 2011:

    I found your blog site on google and test just a few of your early posts. Continue to maintain up the excellent operate. I just additional up your RSS feed to my MSN Information Reader. Seeking ahead to studying extra from you later on!…

  3. 3 asian massage in minneapolis said at 10:44 am on July 9th, 2011:

    You made some decent factors there. I looked on the internet for the issue and found most individuals will associate with with your website.


Leave a Reply


  • six − = three