Archive for May 2014

Set Automatic Individual Corporate Outlook Web App (OWA) Signatures in Exchange Online / Office 365 with PowerShell

An e-mail signature is part of your corporate branding. Having a professional, uniform e-mail signature across your organization increases recognizability, allows clients to quickly find contact information and allows your business to use it as a spot for advertising.

Requesting employees in a large organization to create and design similar signatures is nearly impossible. Check out this crazy before-picture of the situation in our health care organization. Complete with blue handwriting fonts and Comic Sans. Lovely. Fortunately there are software tools available, such as RES Workspace Manager, to set a default, corporate signature in Outlook, but these tools only support the full version of Outlook. As businesses are moving to the cloud, more and more applications, including Outlook, will be offered web-based only.

Automatic e-mail signature in Outlook 2013 generated by RES Workspace Manager

The larger part of our employees are kiosk users, who have access to Outlook Web App (OWA) only, as a component of Office 365. We would still like to prevent a signature mess like before and preconfigure uniform, corporate signatures.

PowerShell to the rescue! With PowerShell you can connect to Exchange Online using an administrative or service account and set OWA signatures. I've written a script that sets a template signature for everybody and also inputs their individual contact information by replacing specific variables in the HTML code, such as %DisplayName%, %Title%, %Phone% and so on, with the values from the appropriate Active Directory User Attributes.

Note: by design this script only sets automated signatures for users who have never set a signature before or who have cleared their signature. See "Final Remarks" for other options.


  1. Download and extract Here's a link to view the code.
  2. Open SetOWASignatures.ps1 and replace "admin@<company>" with your Office 365/Exchange Online admin account.
  3. Securely save your password in an encrypted format in Password.txt in the root directory of the script. This is required to run the script without user interaction. You can use the following PowerShell command to generate the Password file:
    Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File "<path to root of script>\Password.txt"
    Verify that your directory security is set up correctly.
  4. Modify Signature.html to reflect your brand. The variables %DisplayName%, %Title%, %Phone% and so on, will be automatically replaced by the script with the appropriate Active Directory User Attributes.
  5. Run the script (it will not modify existing signatures as only unset or cleared signatures will be set).

Automatic email signature in Outlook Web App (OWA) in Office 365.

(Optional) Schedule the script to run periodically

You can schedule this script using Task Scheduler to run periodically on any Windows Server in your infrastructure. This way new users and users who have cleared their signature will automatically receive the preconfigured company signature.

Final Remarks

  • If you want to use images, such as logo's, in your signature, use absolute URL's which are publically accessible.
  • Minor alternations to the Where-Object block of the script can change the way it functions. E.g.: reset all user signatures, even those already set previously, or set signatures in which users entered a specific string, such as <insert_signature>, and so on. If you would like to extend or modify the functionality of the script in such a manner but don't know how, please don't hesitate to leave a comment.

Copyright Dave Thijssen. Powered by Blogger.