Have a script that does the following:
- Checks to see if Microsoft Outlook is installed. If it is..
- Utilizes applescript to determine if Outlook is running. If it is ..
- Tell me the username of the microsoft exchange account is being used.
- If Outlook isnt running, it will report back "Offline"
Tested it as a regular script and works as intended but in in JAMF it doesnt display anything. Neither the email address nor 'offline'. Any thoughts on what isnt right?
#!/bin/bash
if [ -e "/Applications/Microsoft Outlook.app" ]; then
useremail=$(/usr/bin/osascript <<'EOF'
if application "Microsoft Outlook" is running then
tell application "Microsoft Outlook"
user name of every exchange account
end tell
else
return "Offline"
end if
EOF)
Echo "<result>$useremail</result>"
