Archive

Archive for July, 2012

Deploying a Standard Outlook Signature

The company I work for has never had a standard Outlook signature template. People were free to create their own signature and even though people would often just copy and modify the signature of another user, there are multiple templates in use. The company has recently put an emphasis on marketing and has hired a Chief Marketing Officer. Now, there is an initiative for a consistent branding message. As part of this project, I have been asked if we can deploy a standard Outlook signature template to all users. In researching this, I came across this excellent blog post, which shows how to use a powershell logon script to create and set standardized Outlook signatures.

If you follow the source credit, you will see that the script used was created by Jan Egil Ring then modified by Darren Kattan. I implemented this script in my lab and it worked as expected. A couple of things bothered me though. The script provides variables to force the new signature for new messages and/or replies/forwards. If this isn’t set, the user must go into the signature setting in Outlook and set which signature to use for new messages and replies/forwards. Further, even if the variable is set, the user must log off and back on a second time for it to take effect.

In examining the script, it became apparent why the script must be run a second time to set the default signature. First, the code to set the default signature was being run before the code that creates the signature, so it could not set the defaults on the first run because the signature had not yet been created. Second, the variables to force the default signature were being read from the registry and the code to set those registry values was after the code to read them. This meant a null value was being returned on first run. To fix this, I simply rearranged the code so that the code to create the signature is run before the code to set the defaults. I also read the variables to force the default signature from the variable definition in the code instead of from the registry. I’m not sure why these values are even being written to the registry as they are already defined in the code, so the code is taking the defined variable, writing it to the registry then reading that value and placing it into a new variable, which is then used in the code. With these changes, the signature is created and the defaults set the first time the script is run.

To address the issue of the default signatures not being set, unless you want to force them each time the script is run, I created two new user-defined variables; $SetSignatureNew and $SetSignatureReplyForward. Setting either of these variables to ‘1’ will result in the signature being set as the corresponding default when and only when the signature is created or updated with a new template. If either $ForceSignatureNew or $ForceSignatureReplyForward are set to ‘1’ that value will override the corresponding value of $SetSignatureNew or $SetSignatureReplyForward. So, if you want to set the default signatures when the signature is created, but allow the user to set a different default signature, you would set the variables as so:

$SetSignatureNew = ‘1’

$SetSignatureReplyForward = ‘1’

$ForceSignatureNew = ‘0’

$ForceSignatureReplyForward  =’0′

If you want to force the default signatures each time the script runs, you would set the variables as so:

$SetSignatureNew = ‘0’

$SetSignatureReplyForward = ‘0’

$ForceSignatureNew = ‘1’

$ForceSignatureReplyForward  =’1′

Finally, if you want the user to have complete control over selecting the default signatures, you would set the variables as so:

$SetSignatureNew = ‘0’

$SetSignatureReplyForward = ‘0’

$ForceSignatureNew = ‘0’

$ForceSignatureReplyForward  =’0′

If you would like the modified script, you can download here. (change the extension to .ps1)

For instructions on how to implement the script see http://www.edugeek.net/blog_callback.php?b=1016

Categories: Outlook, Powershell