Hi guys,
Just thought I'd post up the vbscript I'm using as it may help a few people.
It runs as a logon script and creates a signature from AD information by doing an LDAP lookup for the particular user. It also adds a slogan down the bottom and two pictures. At the end it also sets the created signature as the default.
My next challenge is trying to figure out if I can get this signature to work in outlook web access as well.
A lot of this is based off the following Microsoft tech article: http://www.microsoft.com/technet/technetmag/issues/2006/10/HeyScriptingGuy/default.aspx
I'm not sure of the forum rules so let me know if I'm not supposed to post script here.
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strTitle = objUser.Title
strDepartment = objUser.Department
strPhone = objUser.telephoneNumber
strMobile = objUser.mobile
strFax = objUser.faxNumber
strEmail = objUser.emailAddress
strStreet = objUser.streetAddress
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 = "Comic Sans MS"
objSelection.Font.Size = "10"
objSelection.Font.Bold = true
objSelection.TypeText strName
objSelection.TypeParagraph()
objSelection.Font.Size = "9"
objSelection.Font.Bold = false
objSelection.TypeText strTitle
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText strStreet
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText "phone - " & strPhone
objSelection.TypeParagraph()
objSelection.TypeText "fax - " & strFax
objSelection.TypeParagraph()
objSelection.TypeText "mobile - " & strMobile
objSelection.TypeParagraph()
objSelection.TypeText "email - " & strEmail
objSelection.TypeParagraph()
objSelection.InlineShapes.AddPicture("J:\Signature\picture1.jpg")
objSelection.InlineShapes.AddPicture("J:\Signature\picture2.jpg")
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.Font.Color = "000,000,255"
objSelection.Font.Italic = true
objSelection.Font.Size = "8"
objSelection.TypeText "Slogan goes here"
Set objSelection = objDoc.Range()
objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"
objDoc.Saved = True
objWord.Quit