Thursday, June 3, 2010

Using Dynamic Signatures in Exchange 2010

Exchange 2010 offers a new feature called Dynamic Signatures.  Dynamic Signatures are hub transport rules that automatically apply a personalized signature to the bottom of an e-mail based on the sender’s Active Directory (AD) attributes.  You can also configure this feature to apply rich, HTML signatures with specific fonts, company logos, and more.

In this article I'll demonstrate how to create a Dynamic Signature based on the user's name, department, phone number, company name and address in AD.  The signature will also include a custom image for each user, as shown below:


Let's get started.  Open the Exchange Management Console and navigate to Hub Transport under Organization Configuration.  Click the Transport Rules tab in the work pane.  Now click New Transport Rule in the Actions pane and configure it as follows:

Begin the Edit Transport Rule wizard by entering a name and description for the rule, as shown below.

Now configure the Conditions for the signature.  I always start by making the new rule apply only to myself, so I can test the rule's functionality before deploying it to everyone.  Once you've confirmed that it functions as expected, you would normally apply this rule "from users that are inside the organization".


For Actions, check "append disclaimer text and fallback to action if unable to apply".  This is where we enter our Dynamic Signature text and variables, as shown below.


Click disclaimer text to enter the text for the Dynamic Signature.  You can use standard HTML or plain text for the signature.  In this demo I'm using HTML, which allows me to specify text formatting and allows me to create a custom link to a photo on a web server.

Tip: You can use an HTML editor like Microsoft Web Expressions or Frontpage to create the basic layout of the signature, and then paste it into the Specify Disclaimer Text box for editing.

The trick to making the signature dynamic is to use variables for attributes in Active Directory.  These variables must be placed between %% symbols.  For example, %%firstname%%.  The following is a list of the supported variables that are available:
  • UserLogonName
  • DisplayName
  • FirstName
  • Initials
  • LastName
  • PhoneNumber
  • OtherPhoneNumber
  • HomePhoneNumber
  • OtherHomePhoneNumber
  • PagerNumber
  • MobileNumber
  • FaxNumber
  • OtherFaxNumber
  • Email
  • Street
  • POBox
  • City
  • State
  • ZipCode
  • Country
  • Title
  • Department
  • Manager
  • Office
  • Company
  • Notes
  • CustomAttribute1 – CustomAttribute15
Enter the the signature text into the Specify Disclaimer Text box as shown below.


The HTML text I'm using in this demo is as follows.


<html>

<body>
<table border="0" width="100%">
<tr>
<td width="85">
<img border="1" src="http://www.expta.com/images/%%Firstname%%%20%%Lastname%%.jpg">
</td><td valign="top"><font face="Garamond">
<b>%%Firstname%% %%Lastname%%</b></font><br>
<font size="2" face="Calibri">%%department%%<br>
Telephone: %%Phone%% <br>
%%Company%% <br>
%%Street%% <br>
%%City%%, %%State%% %%ZipCode%%
</font></td>
</tr>
</table>
</body>
</html>
This code creates a two column, single row table with a graphic in the first cell (in red) and the formatted text in the second cell (in blue). 

Note that the image is a link to a JPG file named Firstname[%20(space)]Lastname.jpg in the images folder on the http://www.expta.com/ server.  Each user will need a JPG file in the images folder on the web server in this Firstname Lastname.jpg format.

Alternatively (and to keep it more simple), you could opt to use a single image for all users, such as a company logo.  Simply change the line in red to a static link, such as:
<img border="1" src="http://www.expta.com/images/logo.jpg">
Now finish the Edit Transport Rule wizard to complete the Dynamic Signature rule and test it out.


As with all the Exchange 2010 wizards, you have the opportunity to copy the Powershell code that will be used to create the transport rule.  This allows you to save and edit the code for future use.

25 comments:

  1. do you need outlook 2010 to utilize these features?
    ReplyDelete
  2. No, but you do need Exchange 2010.
    ReplyDelete
  3. This feature is a beauty! Have it working for all my nonblackberry users. That being said, has anyone found a fix for the blackberry plain text issue?

    Blackberries generate all new emails in plaintext which causes the signature to reveal all HTML coding.

    Would love to know if there is a fix (ie.suppress the signature from mobile devices)
    ReplyDelete
  4. Hi Jeff,
    I've already set the automatic signature, but when you want to reply or forward the email, the signature is come out to the bottom of the mail, not come out to the the bottom of reply email.
    Please help :)
    ReplyDelete
  5. Julius,

    You're right, I never tested that (an apparently, neither did the Exchange team).

    When you add a disclaimer or dynamic signature using a hub transport rule, it always appends it to the very bottom of the message thread, rather than insert it inline, like Outlook does. Apparently, this is expected behavior (see http://technet.microsoft.com/en-us/library/aa998315(EXCHG.80).aspx).

    I guess the best way to handle this is to create an exception that does not append the signature if it already exists or if you're replying or forwarding a message. Not very elegant.

    I'll ask the Exchange product team about it.
    ReplyDelete
  6. Can you have different signatures based upon departments etc?
    ReplyDelete
  7. Hi Jeff,

    How can I do this Exception configuration mentioned by you in your last post?

    Best regards,
    Paulo
    ReplyDelete
  8. Paulo,

    Make sure that the dynamic signature includes a unique word or phrase, maybe a company slogan like "Customer service is our top priority". Then edit the transport rule and in Exceptions use "except when the Subject field or message body contains specific words", then enter the company slogan as the specific words.
    ReplyDelete
  9. I really want to use this, and not Exclaimer... Unfortunately, having to choose between only one sig, or sigs repeatedly applied to the bottom of the messages makes this a no go for sure...

    Also, some "if exist" statemtens would be nice...
    ReplyDelete
  10. Hi there,

    Is there a way to add this *not* at the bottom of the email thread? I'd like to add this to the bottom of an email at the bottom of what has just been written (like an email signature) rather than at the bottom of the entire email.

    Regads,

    Kim
    ReplyDelete
  11. Need a way to embed images like Outlook. Most clients block external images.
    ReplyDelete
  12. Anybody came out with a solution for the forementioned issue? (signatures of replied emails appended at the bottom)
    ReplyDelete
  13. Does any one have a solution for the signature always appearing at the end of the eamail?
    ReplyDelete
  14. Jeff,

    One option I've been experimenting is is during the initial send we set a header to Disclaimer=Yes, and on the second time we check for that header.
    ReplyDelete
  15. has anyone found a fix for the disclaimer directly below reply?
    ReplyDelete
  16. has anyone found a fix for the disclaimer directly below reply?
    ReplyDelete
  17. Vivekbb, I suggest following the idea listed by Anonymous (right above your comment). Setting an X-Header and then checking for it should work.
    ReplyDelete
  18. not able to see image. after writing correct as well
    ReplyDelete
  19. is there any code of inserting background image to all the new mails in exchange through HTML code using disclaimer
    ReplyDelete
  20. Any Updates...
    ReplyDelete
  21. It is not possible to insert the signature anywhere but the bottom ot the message at this time.
    ReplyDelete
  22. What a GREAT tool this would be if MS wouldn't have forgotten that 99% of email signatures appear right after the reply. Is there any update from MS regarding the issue with the signature appearing at the bottom of the email string?
    ReplyDelete
  23. No update. It's really a lot more complicated than you might think.
    ReplyDelete
  24. I don't think it can be too hard to do. There 3rd party products on the market that have this functionality for Exchange 2010. I was hoping not to have use another product to manage my email signatures when I upgraded to 2010.
    ReplyDelete

Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.