Monday, 20 March 2017

Outlook Common Signature form group policy

Modify below highlighted text and save it has .vbs file.

Create a group policy and select this .vbs file in user configuration log on policy.

Its done



On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

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

strName = objUser.displayname
strTitle = objUser.Title
strAddress = objUser.streetAddress
strDepartment = objUser.Department
strCompany = "Company Name. | Address, Address1 | Address2, Address3 | Address4 – 111111, India"
strPhone = objUser.telephoneNumber
strMob = objUser.mobile
strWeb = "www.website.com"
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.Size = "11.5" 
objSelection.Font.Name = "Tahoma"
objSelection.Font.Color = RGB (22,64,141)
objSelection.Font.Bold = true 
objSelection.TypeText strName & Chr(11)
objSelection.Font.Bold = false
objSelection.Font.Size = "10.5"
objSelection.Font.Color = RGB (0,0,0)
objSelection.TypeText strTitle & " - " & strDepartment & Chr(11)
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB (130,130,130)
objSelection.TypeText strAddress & Chr(11)
objSelection.Font.Size = "11"
objSelection.TypeText "D: +91 80 " & strPhone & " | M: +91 " & strMob & Chr(11)
objSelection.TypeText "B: +91-80-39285450/451" & Chr(11)
objSelection.Font.Size = "10.5"
objDoc.Hyperlinks.Add objSelection.Range, strWeb
objSelection.TypeText Chr(11)
objSelection.InlineShapes.AddPicture("\\systemname\netlogon\image.jpg")

Set objSelection = objDoc.Range()

objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"

objDoc.Saved = True
objWord.Quit

No comments:

Post a Comment

PHP vs Python : Which one is the Best Server-Side Programming?

PHP vs Python, the two most popular back-end programming languages. Python has the variety of dynamic features with simple script whereas ...