Outlook Signature Templet

sjha967
New Contributor II

Anyone have a solution for automating outlook signatures? I'd love to be able to use a template with someone filling in first name last name, phone number, address, company logo, email etc.

2 REPLIES 2

choudhary
New Contributor

i am also looking for it.

Stevie
Contributor

Hi,

There are a couple of things which you will need to do when planning to setup user signatures. First, you need to work out what data you are going to put into your user signature and secondly, how your are going to read the data into the signature file. It seems simple at first but you need to plan for this to be as light touch as possible. I recommend setting the signatures up once and then letting the user changing them via self service, you don't want to working out if a users job title changed every day.

If you been able to get Jamf to read everything in from Active Directory then you can user the built in variables within Jamf to push things like email address, department name, building, job title and address. I have include a json profile as an example so you can see what variables you get setup locally from Jamf software.

Now, you use a script to create a html file of your signature with the variables from Jamf server and then tell Microsoft Outlook via AppleScript to delete all current signatures and load the new one which has just been created.

JSON variables Example

com.samplepayload
{
  "title": "com.samplepayload",
  "description": "Sample Payload",
  "properties": {
    "Room": {
      "title": "Room",
      "description": "$ROOM",
      "property_order": 5,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "MAC Address": {
      "title": "MAC Address",
      "description": "$MACADDRESS",
      "property_order": 10,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Site Name": {
      "title": "Site Name",
      "description": "$SITENAME",
      "property_order": 15,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Position": {
      "title": "Position",
      "description": "$POSITION",
      "property_order": 20,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Computer Name": {
      "title": "Computer Name",
      "description": "$COMPUTERNAME",
      "property_order": 25,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "UDID": {
      "title": "UDID",
      "description": "$UDID",
      "property_order": 30,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Phone Number": {
      "title": "Phone Number",
      "description": "$PHONE",
      "property_order": 35,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Extension Attribute ID Number": {
      "title": "Extension Attribute ID Number",
      "description": "",
      "property_order": 40,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "array",
          "items": {
            "type": "string",
            "title": "Entries"
          }
        }
      ]
    },
    "Email Address": {
      "title": "Email Address",
      "description": "$EMAIL",
      "property_order": 45,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Department ID": {
      "title": "Department ID",
      "description": "$DEPARTMENTID",
      "property_order": 50,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Jamf Pro ID of the Configuration Profile": {
      "title": "Jamf Pro ID of the Configuration Profile",
      "description": "$PROFILEJSSID",
      "property_order": 55,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Building ID": {
      "title": "Building ID",
      "description": "$BUILDINGID",
      "property_order": 60,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Serial Number": {
      "title": "Serial Number",
      "description": "$SERIALNUMBER",
      "property_order": 65,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Jamf Pro ID": {
      "title": "Jamf Pro ID",
      "description": "$JSSID",
      "property_order": 70,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Department Name": {
      "title": "Department Name",
      "description": "$DEPARTMENTNAME",
      "property_order": 75,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Site ID": {
      "title": "Site ID",
      "description": "$SITEID",
      "property_order": 80,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Full Name": {
      "title": "Full Name",
      "description": "$FULLNAME",
      "property_order": 85,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Building Name": {
      "title": "Building Name",
      "description": "$BUILDINGNAME",
      "property_order": 90,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    },
    "Username": {
      "title": "Username",
      "description": "$USERNAME",
      "property_order": 95,
      "anyOf": [
        {
          "type": "null",
          "title": "Not Configured"
        },
        {
          "title": "Configured",
          "type": "string"
        }
      ]
    }
  }
}

Just put the description name into the blank field for this example and then set the scope to your computer..

Example outlook signature script.

#!/bin/bash

loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`

Title="My Job Title"
Address="Line 1, Post Code"
DirectLine="0800-1234567"
SwitchBoard="0800-1234567"

echo "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Default Signature</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.21015" name=GENERATOR>
</HEAD>
<body lang=EN-GB link=blue vlink=blue style='font-family:Calibri, Arial, sans-serif; font-size:8.0pt;'>
<span style="font-weight: bold; color: #DA291C; text-transform: uppercase">$loggedInUser</span><br/>
<span style="font-weight: bold; color: #000000">$Title</span><br/><br/>
<span style="color: #000000">My Company Name, $Address</span><br/>
<span style="color: #000000">D: $DirectLine | T: $SwitchBoard</span><br/>
<span style="color: #000000">www.jamfsoftware.com</span><br/><br/>
</body>
"> /Users/"${loggedInUser}"/Documents/Signature/Signature.html

osascript <<EOD

set contentHTML to ("Macintosh HD:Users:$loggedInUser:Documents:Signature:Signature.html") as alias
set contentHTML to (read contentHTML)
tell application "Microsoft Outlook.app"
    with timeout of 360 seconds
    delete signatures
    make new signature with properties {name:"Signature", content:contentHTML}
    end timeout
end tell
EOD

This should be enough to get you started.

regards

Steve