Use Entourage email address to fill JSS Location

Cem
Valued Contributor

This script will determine that Entourage is running then it will collect the Exchange email address and it will populate the JSS Location. Only way to do this when Entourage is running. So I didn't want to freak out users by just running Apple Script as it will open up Entourage.
It could be useful for someone...

You can also use this script for Outlook too! Just replace where ever it says Entourage with Outlook.

Some parts of the script has been inspired from William Smith, Thomas Larkin and Thorsten Hesse's ideas and from their scripts they have posted in this mailing list.

#!/bin/bash

# Lets check the Entourage is running

if [[ `ps -ax | grep -v grep | grep -c 'Microsoft Entourage'` == 1 ]] #if it was successful

    then /bin/echo "Entourage is running, continuing as planned..."

    else /bin/echo "Entourage is NOT running, we need to halt" 

    exit 55

fi

###Read email fields into variables.

EMAIL=`osascript -e 'tell application "Microsoft Entourage" to get email address of Exchange account 1'`


###Reset variables to remove white space.

EMAIL=`echo $EMAIL`
echo $EMAIL


###Run Recon and insert values in Location fields.
/usr/sbin/jamf recon -email "$EMAIL"
4 REPLIES 4

Not applicable

I was interested in writing to the JSS location and tried running the last command, but doesn't seem to be working for me. Tried the last command with an email variable and tried it by assigning an email address to the variable and running it exactly as shown, but still no luck. Am i missing something?

Cem
Valued Contributor

just tested this command from my test client Mac and it worked on both JSS v7.31 and v8.31

/usr/sbin/jamf recon -email "test.name@my.com"

I am not sure why wouldn't work for you?!
Try run Recon.app from client Mac and fill the email section. See that's working for you.

Not applicable

I ran the Recon.app from client Mac and it filled the email section. So, deleted it and tried the command again from the command line and still not working.

Cem
Valued Contributor

perhaps updating jamf binary may help.
Or I would just remove the framework with this command:
sudo jamf removeFramework

I would consider removing the casper management ssh account from that client too.

then run Recon.app and recreate the management account etc.

then try.