Case of the Automatic Outlook Signature Configuration Failure

An environment was using logon batch file, that called a VBS to automatically configure Outlook signatures. The signature had a different image attached to the end of it dependent on current marketing campaign.

One day it stopped working, manually running the script showed the following error

outlookad.vbs(256, 3) Microsoft VBScript runtime error: Object required: ‘objRoot’

This line had code like this:

for each campaign in objRoot.childNodes

Searching backwards in the code we found objRoot was assigned by loading XML:

Set xmlDoc = CreateObject(“Msxml.DOMDocument”)
xmlDoc.load strLogonServer & “\netlogon\marketingCampaigns.xml”
Set objRoot = xmlDOc.documentElement

Added a quick to see if XML was loading:

Set xmlDoc = CreateObject(“Msxml.DOMDocument”)
if (xmlDoc.load(strLogonServer & “\netlogon\marketingCampaigns.xml”)) Then
    WScript.Echo “XML loaded OK!”
Else
    WScript.Echo “XML Failed to load!”
End If

Set objRoot = xmlDOc.documentElement

The script output “XML Failed to load!”

Checking the XML file we could see it had last modified date of a week ago, and had content like below:

<?xml version=”1.0″?>
<campaigns>
  <campaign>
     <applicableGroup>DL-Australia</applicableGroup>
     <imageFile>NEW-Email_Footer.jpg</imageFile>
     <url>
http://www.contoso.com/?utm_source=EmailSignature&utm_campaign=CWT2017</url>
  </campaign>
</campaigns>

The issue was the XML had unescaped ampersand added into the URL field … replacing & with &amp; fixed the issue.

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Office and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s