Setting up an email signature for each Outlook user in the organization can be a time consuming job, especially when performed manually. Moreover – every time a change in the signature is required the whole process needs to be repeated.
That is why system administrators are searching the web for a more centralized way of performing this task. One of the possible solutions is to run a logon script, distributed to workstations via the Group Policy Object. When the end user logs on the script gathers information about that particular person from Active Directory and creates a personalized email signature in Outlook. Below you will find a guide how to configure such script.
Firstly you need a VBS script that creates a signature in Outlook. Below you can find an example code, that reads user’s information from Active Directory. That information is then inserted into the signature. Lastly, the script sets the signature to be added in new emails and reply emails.
On Error Resume Next Set objSysInfo = CreateObject("ADInformation") strUser = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUser) If objUser Is Empty Then _ MsgBox "No connection with LDAP information.", _ vbCritical, "Error": Exit Sub strName = objUser.FullName strTitle = objUser.Title strDepartment = objUser.Department strCompany = objUser.Company strPhone = objUser.telephoneNumber 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 ' Beginning of signature block objSelection.TypeText strName & ", " & strTitle objSelection.TypeParagraph() objSelection.TypeText strDepartment objSelection.TypeParagraph() objSelection.TypeText strCompany objSelection.TypeParagraph() objSelection.TypeText strPhone ' End of signature block Set objSelection = objDoc.Range() objSignatureEntries.Add "AD Signature", objSelection objSignatureObject.NewMessageSignature = "AD Signature" objSignatureObject.ReplyMessageSignature = "AD Signature" objDoc.Saved = True objWord.Quit
Simply copy the above text into any plain text editor (e.g. Windows Notepad) and save it with the VBS file extension.
To test the script execute it on a workstation with Outlook installed (make sure that Outlook is not running). Next time you launch Outlook and create a new message it should contain a signature, similar to the example below:
To modify the signature change the code between ‘ Beginning of signature block and ‘ End of signature block in the script. Let’s say you need to add user’s email address at the very end of the signature. You can do this by adding the following line in the signature block of the script:
objSelection.TypeParagraph() objSelection.TypeText strEmail
The resulting signature block in the script is as follows:
' Beginning of signature block objSelection.TypeText strName & ", " & strTitle objSelection.TypeParagraph() objSelection.TypeText strDepartment objSelection.TypeParagraph() objSelection.TypeText strCompany objSelection.TypeParagraph() objSelection.TypeText strPhone objSelection.TypeParagraph() objSelection.TypeText strEmail ' End of signature block
To enter any string of text that is not dynamically gathered from Active Directory, simply replace the placeholder part of the objSelection.TypeText command (e.g. strEmail) with a text placed between the quotation marks. In the example below the environmental disclaimer is added:
' Beginning of signature block objSelection.TypeText strName & ", " & strTitle objSelection.TypeParagraph() objSelection.TypeText strDepartment objSelection.TypeParagraph() objSelection.TypeText strCompany objSelection.TypeParagraph() objSelection.TypeText strPhone objSelection.TypeParagraph() objSelection.TypeText strEmail objSelection.TypeParagraph() objSelection.TypeText "Please consider the environment before printing this message." ' End of signature block
Distributing the signature via GPO
To distribute the script automatically to all workstations in the organization the easies way is to use the GPO policy. This method will provide every single user with the signature when they log on into their computer.
To begin log on to your server and click the Start menu button, then select Administrative Tools menu and click Group Policy Management. Alternatively you can run the gpmc.msc command in the Start menu search field. This opens the main GPO console window:
In the left pane expand the branch with your server name, then expand Group Policy Objects. Next right-click the Default Domain Policy object select Edit.
In the Group Policy Management Editor navigate to User Configuration in the left pane, then go to: Policies, Windows Settings, Scripts (Logon/Logoff).
Next, double click the Logon option visible in the right pane which launches the Logon Properties window. Then click the Show Files… button to open the folder containing scripts. Copy your VBS script into that folder. Next, in the Logon Properties window click the Add… button and select the script file that you just copied in by clicking the Browse… button.
Save the settings by clicking the OK button all the way down.
That’s it – next time your users login on their workstations the script will launch and create the Outlook signature that contains user’s AD information.
This method is fairly useful, however it has a couple of drawbacks:
- Users can modify their signatures before sending which might breach the unified signature look regulation.
- Every change in the signature requires all users to log off and log back on to re-run the script and apply changes.
- Signature editing is quite complicated and requires a bit of programming knowledge.
- Administrative access to the server is required.
Easy to use GUI that lets you create any kind of signature in a friendly way;
- A signature testing facility allows to check and see how your signature template looks like before deploying it to the live environment;
- It supports all emails processed by the Exchange transport service, no matter from what email client they were sent by the end user;
- The program provides a remote access to the signature deployment. This way the process can be delegated to e.g. your marketing team without giving them direct access to the server;
- A rich library of ready to use signature templates is available;
- All email formats are supported – no matter it’s HTML, Plain Text, or RTF;
- You can download and use the fully functional program for 30 days to see if it suit your needs.
- And more.