read account info from Entourage

Cem
Valued Contributor

Anyone knows how to read account info from Entourage?
I have few users and their Macs are not bound to AD and I would like to
identify the owners. Some Macs are 10.6 and some 10.5 all still have
Entourage.

I would like to create an Extension Attribute.

Is this the file where address info is hidden?
~/Library/Preferences/com.microsoft.office.plist
Strings to read??
2008UserInfoUserAddress
2008UserInfoUserName

I have ran this on one of the Macs:
cat ~/Library/Preferences/com.microsoft.office.plist

But none of the string info above shown

Any thoughts?

10 REPLIES 10

Cem
Valued Contributor

Ok got it:
defaults read ~/Library/Preferences/com.microsoft.office

Defaults command gives the necessary info...

talkingmoose
Moderator
Moderator

This will give you the user name from that file:
On 12/12/11 9:56 AM, "Baykara, Cem" <Cem.Baykara at BSKYB.COM> wrote:

defaults read ~/Library/Preferences/com.microsoft.office
"2008UserInfoUserName"

However, if you're running the extension attribute using ~/ then you
already know the current user. I'm not understanding what looking into a
.plist file is going to gain you here.

If you assume that anyone who has "/Applications/Microsoft Office
2008/Microsoft Entourage.app" installed is an Entourage user then you can
simply list your users on that machine.

What are your criteria for determining that someone is indeed using
Entourage?

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

Cem
Valued Contributor

These Macs are not bound to any directory. So all accounts are static and named same for all computers. So ~/ read doesn't give much info.

I need to get some contact info from Entourage. I know users email address is in Accounts Settings in GUI. That's what I want.

defaults read ~/Library/Preferences/com.microsoft.office "2008UserInfoUserName"

Command above also returned with useless info. As it hasn't been configured properly. I have this bunch of old builds that I would like to update. Thats why I need to identify the users first for comms purpose.

How will I get the email address from Accounts Settings in Entourage?

Cem

Sent from my iPhone

This will give you the user name from that file:

defaults read ~/Library/Preferences/com.microsoft.office
"2008UserInfoUserName"

However, if you're running the extension attribute using ~/ then you
already know the current user. I'm not understanding what looking into a
.plist file is going to gain you here.

If you assume that anyone who has "/Applications/Microsoft Office
2008/Microsoft Entourage.app" installed is an Entourage user then you can
simply list your users on that machine.

What are your criteria for determining that someone is indeed using
Entourage?

Not applicable

Maybe I'm missing something but how about an Applescript? Something like



*tell* *application* "Microsoft Entourage"

*set* theaccount *to* *Exchange account* 1

*return* (Exchange ID *of* theaccount *as* *string*)

*end* *tell*


or you could get back the email address or the full name by using other
properties of the exchange account object:

*return* (email address *of* theaccount *as* *string*)

*return* (full name *of* theaccount *as* *string*)

*
*

talkingmoose
Moderator
Moderator

How will I get the email address from Accounts Settings in Entourage?
On 12/12/11 5:35 PM, "Baykara, Cem" <Cem.Baykara at bskyb.com<mailto:Cem.Baykara at bskyb.com>> wrote:

I only see user name included in the .plist file. I don't see email address. And if this is the same information as in Outlook for Mac then it's not really the name of the person but rather the name used during installation. This is what would appear in the splash screen.

Account details are all stored in Entourage's monolithic Database file, which cannot be read easily by anything other than Entourage itself. This isn't something you can parse via command line because the file is generally large (hundreds of MB to GB) and must be completely loaded before it can be searched.

Sven's suggestion to use AppleScript would work but it cannot be run silently. The user would need to be logged into the computer and he would have to run the script manually. Or you'd have to log in as the user yourself and run the script.

You can, however, use osascript to run an AppleScript silently so long as it doesn't need to do anything with the GUI. Run this shell script and it will silently return the email address of the current user in the form "user at domain.com<mailto:user at domain.com>" if Entourage is already running:

#!/bin/sh
osascript -e 'tell application "Microsoft Entourage" to get email address of Exchange account 1'
exit $?

If Entourage is not running then it will launch first and then return the email address.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492

ToriAnneke
Contributor II

This is an AS I used for a few years during the Entourage days to set up Exchange accounts. Need to adjust it to suit your domain structures.

I'm not that good with AppleScript anymore since the OS9 days went away but I would start with this and pick it apart to get what you want it to do.

I got it from here http://macscripter.net/viewtopic.php?id=28984

--

Pat Camporeale
This is the age of "I want it now" … so why do you expect it to work properly?

(*

--------------------------------------------
Entourage Exchange Setup 2.0
©2008 William Smith
mecklists at comcast.net

This script may be freely modified for personal or commercial
purposes but may not be republished for profit without prior consent.

If you find this script useful or have ideas for improving it, please let me know.
It should be compatible with both Entourage 2004 and 2008, including Kerberos support.

Thank you, Kristen Dietiker, for reporting a bug in Entourage 2008
where SSL for LDAP will always be enabled. I have tweaked the account
creation to honor the correct setting.

Thank you, Don Montalvo, for your suggestion to include
a seventh E-mail example for user short name.
--------------------------------------------

This script assists a user with the setup of his Exchange account
information.

  1. Customize the network and server properties below with information
    appropriate to your network.

  2. Customize the format of your company's email addresses.

  3. Save this script as an application and store it in a location where
    any user can double-click it to set up his own email account.
    Entourage should not yet be running when this script is run.

This script assumes the user's full name is in the form of "Last, First",
but is easily modified if the full name is in the form of "First Last".
It works especially well if the Mac is bound to Active Directory where
the user's short name will match his login name.

*)

--------------------------------------------
-- Begin network and server properties
--------------------------------------------

property useKerberos : true
-- Set this property to true only if using Entourage 2008
-- and Macs in your environment are bound to Active Directory.
-- Kerberos support works only if your network is properly configured.

property kerberosDomainName : "xxx"
-- For most Kerberos environments the Kerberos domain name
-- will be the same as the E-mail domain name. This property is used
-- only if the userKerberos property above is true.

property domainName : "xxx.com"
-- example: "domain.com"

property WindowsDomain : "xxx"
-- example: "DOMAIN"

property ExchangeServer : "xxx"
-- example: "ExchangeServer.domain.com"

property ExchangeServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set to true.

property ExchangeServerSSLPort : 80
-- If ExchangeServerSSL is false set the port to 80.
-- If ExchangeServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property PublicFolderServer : "xxx/public/"
-- example : "FreeBusyServer.domain.com/public/"

property PublicFolderServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set to true.

property PublicFolderServerSSLPort : 80
-- If PublicFolderServerSSL is false set the port to 80.
-- If PublicFolderServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property LDAPServer : "xxx"
-- example: "GlobalCatalogServer.domain.com"

-- OWA connections can not use the OWA address.

property LDAPRequiresAuthentication : true
-- This will almost always be true. The LDAP server in a Windows network
-- will be a Global Catalog server, which is separate from the Exchange Server.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSLPort : 3268
-- If LDAPServerSSL is false set the port to 3268.
-- If LDAPServerSSL is true set the port to 3269.
-- Use a different port number only if specified by your administrator.

-- OWA connections can not use the OWA address with this setting.

property LDAPMaximumResults : 1000
-- When searching the Global Address list, this number determines
-- the maximum number of entries to display.

property LDAPSearchBase : ""
-- example: "cn=users,dc=domain,dc=com"

-- Search base will be optional in many environments and its
-- format will vary greatly. Experiment first connecting without
-- entering the search base information.

property scheduled : false
-- Exchange accounts don't require that the "Send & Receive All" schedule be enabled.
-- Change this setting to true if the user will also be connecting to POP or IMAP accounts.

property errorMessage : "Setup of your account failed. Please contact your workstation administrator for assistance."
-- Customize this error message for your users if their account setup fails

--------------------------------------------
-- End server properties
--------------------------------------------

--------------------------------------------
-- Begin get user name
--------------------------------------------

-- user information is pulled from the account settings of the current user account

tell application "System Events" set shortName to name of current user set fullName to full name of current user
end tell

--------------------------------------------
-- End get user name
--------------------------------------------

--------------------------------------------
-- Begin email address properties
--------------------------------------------

-- Email address formats vary between organizations.
-- Seven common examples are give below but only one should be used.
-- The rest should be commented out by adding "-- " to the beginning of the line.
-- Your email address format may differ from all of these. If so,
-- you'll need to determine the proper script syntax and add your own entry.

-- example 1: first.last at domain.com if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "." & word 1 of fullName & "@" & domainName

-- example 2: first.last at domain.com if full name displays as "First Last"
set emailAddress to word 1 of fullName & "." & word 2 of fullName & "@" & domainName

-- example 3: first at domain.com if full name displays as "First Last"
-- set emailAddress to word 1 of fullName & "@" & domainName

-- example 4: first at domain.com if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "@" & domainName

-- example 5: flast at domain.com if full name displays as "First Last"
-- set emailAddress to character 1 of word 1 of fullName & word 2 of fullName & "@" & domainName

-- example 6: flast at domain.com if full name displays as "Last, First"
-- set emailAddress to character 1 of word 2 of fullName & word 1 of fullName & "@" & domainName

-- example 7: short at domain.com
-- set emailAddress to shortName & "@" & domainName

--------------------------------------------
-- End email address properties
--------------------------------------------

--------------------------------------------
-- Begin setup check
--------------------------------------------

-- Is Entourage already configured? This section checks for the existence
-- of an Exchange Server account already in Entourage. It assumes that
-- users will have only one Exchange Server account.

tell application "Microsoft Entourage" if (exists of Exchange account 1) is true then set theAnswer to display dialog "Entourage is already configured with an email account. Are you sure you want to set up another email account?" buttons {"Yes", "No, just use Entourage"} default button {"No, just use Entourage"} with icon 2 with title "Alert!" if button returned of theAnswer is "No, just use Entourage" then display dialog "OK. Next time you can just launch Microsoft Entourage directly." buttons {"OK"} default button {"OK"} with icon 1 with title "For your information..." return -- exits the script end if end if
end tell

--------------------------------------------
-- End setup check
--------------------------------------------

--------------------------------------------
-- Begin account setup
--------------------------------------------

try

set verifyEmail to display dialog "Please verify that your email address is correct." default answer emailAddress with icon 2 buttons {"Cancel", "OK"} default button {"OK"} set emailAddress to text returned of verifyEmail

set verifyServer to display dialog "Please verify that your Exchange Server name is correct." default answer ExchangeServer with icon 2 buttons {"Cancel", "OK"} default button {"OK"} set ExchangeServer to text returned of verifyServer

tell application "Microsoft Entourage" activate set newExchangeAccount to make new Exchange account with properties {name:"Mailbox - " & fullName, Exchange ID:shortName, domain:WindowsDomain, full name:fullName, email address:emailAddress, search base:LDAPSearchBase, Exchange server settings:{address:ExchangeServer, requires SSL:ExchangeServerSSL, port:ExchangeServerSSLPort}, public folder server settings:{address:PublicFolderServer, requires SSL:PublicFolderServerSSL, port:PublicFolderServerSSLPort}, LDAP server settings:{address:LDAPServer, LDAP requires authentication:LDAPRequiresAuthentication, requires SSL:LDAPServerSSL, port:LDAPServerSSLPort, maximum entries:LDAPMaximumResults}}

-- This line corrects a bug in Entourage 2008 where the SSL setting for the LDAP server -- will always be enabled. The property chosen above will be honored.

set LDAP requires authentication of newExchangeAccount to LDAPRequiresAuthentication

-- The following lines enable Kerberos support only if Entourage 2008 is installed -- and the userKerberos property above is set to true.

if version contains "12" and useKerberos is true then set requires Kerberos of newExchangeAccount to useKerberos set principal of newExchangeAccount to useKerberos end if

try close window "Entourage Setup Assistant" end try

set enabled of schedule "Send & Receive All" to scheduled

end tell

on error

display dialog errorMessage with icon 2 buttons {"OK"} default button {"OK"}

end try

carlo_anselmi
Contributor III

The script updated for Outlook 2011
http://www.officeformachelp.com/outlook/exchange/setup-script/

Cheers
Carlo

Da: Pat Camporeale <Pat.Camporeale at wk.com<mailto:Pat.Camporeale at wk.com>>
Data: Wed, 14 Dec 2011 02:33:51 -0600
A: "casper at list.jamfsoftware.com<mailto:casper at list.jamfsoftware.com>" <casper at list.jamfsoftware.com<mailto:casper at list.jamfsoftware.com>>
Oggetto: Re: [Casper] read account info from Entourage

This is an AS I used for a few years during the Entourage days to set up Exchange accounts. Need to adjust it to suit your domain structures.

I'm not that good with AppleScript anymore since the OS9 days went away but I would start with this and pick it apart to get what you want it to do.

I got it from here http://macscripter.net/viewtopic.php?id=28984

--

Pat Camporeale
This is the age of "I want it now" … so why do you expect it to work properly?

(*

--------------------------------------------
Entourage Exchange Setup 2.0
©2008 William Smith
mecklists at comcast.net<mailto:mecklists at comcast.net>

This script may be freely modified for personal or commercial
purposes but may not be republished for profit without prior consent.

If you find this script useful or have ideas for improving it, please let me know.
It should be compatible with both Entourage 2004 and 2008, including Kerberos support.

Thank you, Kristen Dietiker, for reporting a bug in Entourage 2008
where SSL for LDAP will always be enabled. I have tweaked the account
creation to honor the correct setting.

Thank you, Don Montalvo, for your suggestion to include
a seventh E-mail example for user short name.
--------------------------------------------

This script assists a user with the setup of his Exchange account
information.

  1. Customize the network and server properties below with information
    appropriate to your network.

  2. Customize the format of your company's email addresses.

  3. Save this script as an application and store it in a location where
    any user can double-click it to set up his own email account.
    Entourage should not yet be running when this script is run.

This script assumes the user's full name is in the form of "Last, First",
but is easily modified if the full name is in the form of "First Last".
It works especially well if the Mac is bound to Active Directory where
the user's short name will match his login name.

*)

--------------------------------------------
-- Begin network and server properties
--------------------------------------------

property useKerberos : true
-- Set this property to true only if using Entourage 2008
-- and Macs in your environment are bound to Active Directory.
-- Kerberos support works only if your network is properly configured.

property kerberosDomainName : "xxx"
-- For most Kerberos environments the Kerberos domain name
-- will be the same as the E-mail domain name. This property is used
-- only if the userKerberos property above is true.

property domainName : "xxx.com"
-- example: "domain.com"

property WindowsDomain : "xxx"
-- example: "DOMAIN"

property ExchangeServer : "xxx"
-- example: "ExchangeServer.domain.com"

property ExchangeServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set to true.

property ExchangeServerSSLPort : 80
-- If ExchangeServerSSL is false set the port to 80.
-- If ExchangeServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property PublicFolderServer : "xxx/public/"
-- example : "FreeBusyServer.domain.com/public/"

property PublicFolderServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections will probably require SSL and this setting should be set to true.

property PublicFolderServerSSLPort : 80
-- If PublicFolderServerSSL is false set the port to 80.
-- If PublicFolderServerSSL is true set the port to 443.
-- Use a different port number only if specified by your administrator.

property LDAPServer : "xxx"
-- example: "GlobalCatalogServer.domain.com"

-- OWA connections can not use the OWA address.

property LDAPRequiresAuthentication : true
-- This will almost always be true. The LDAP server in a Windows network
-- will be a Global Catalog server, which is separate from the Exchange Server.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSL : false
-- If Exchange users will connect to a backend server
-- within the same network then SSL is probably not required.
-- OWA connections can not use the OWA address with this setting.

property LDAPServerSSLPort : 3268
-- If LDAPServerSSL is false set the port to 3268.
-- If LDAPServerSSL is true set the port to 3269.
-- Use a different port number only if specified by your administrator.

-- OWA connections can not use the OWA address with this setting.

property LDAPMaximumResults : 1000
-- When searching the Global Address list, this number determines
-- the maximum number of entries to display.

property LDAPSearchBase : ""
-- example: "cn=users,dc=domain,dc=com"

-- Search base will be optional in many environments and its
-- format will vary greatly. Experiment first connecting without
-- entering the search base information.

property scheduled : false
-- Exchange accounts don't require that the "Send & Receive All" schedule be enabled.
-- Change this setting to true if the user will also be connecting to POP or IMAP accounts.

property errorMessage : "Setup of your account failed. Please contact your workstation administrator for assistance."
-- Customize this error message for your users if their account setup fails

--------------------------------------------
-- End server properties
--------------------------------------------

--------------------------------------------
-- Begin get user name
--------------------------------------------

-- user information is pulled from the account settings of the current user account

tell application "System Events" set shortName to name of current user set fullName to full name of current user
end tell

--------------------------------------------
-- End get user name
--------------------------------------------

--------------------------------------------
-- Begin email address properties
--------------------------------------------

-- Email address formats vary between organizations.
-- Seven common examples are give below but only one should be used.
-- The rest should be commented out by adding "-- " to the beginning of the line.
-- Your email address format may differ from all of these. If so,
-- you'll need to determine the proper script syntax and add your own entry.

-- example 1: first.last at domain.com<mailto:first.last at domain.com> if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "." & word 1 of fullName & "@" & domainName

-- example 2: first.last at domain.com<mailto:first.last at domain.com> if full name displays as "First Last"
set emailAddress to word 1 of fullName & "." & word 2 of fullName & "@" & domainName

-- example 3: first at domain.com<mailto:first at domain.com> if full name displays as "First Last"
-- set emailAddress to word 1 of fullName & "@" & domainName

-- example 4: first at domain.com<mailto:first at domain.com> if full name displays as "Last, First"
-- set emailAddress to word 2 of fullName & "@" & domainName

-- example 5: flast at domain.com<mailto:flast at domain.com> if full name displays as "First Last"
-- set emailAddress to character 1 of word 1 of fullName & word 2 of fullName & "@" & domainName

-- example 6: flast at domain.com<mailto:flast at domain.com> if full name displays as "Last, First"
-- set emailAddress to character 1 of word 2 of fullName & word 1 of fullName & "@" & domainName

-- example 7: short at domain.com<mailto:short at domain.com>
-- set emailAddress to shortName & "@" & domainName

--------------------------------------------
-- End email address properties
--------------------------------------------

--------------------------------------------
-- Begin setup check
--------------------------------------------

-- Is Entourage already configured? This section checks for the existence
-- of an Exchange Server account already in Entourage. It assumes that
-- users will have only one Exchange Server account.

tell application "Microsoft Entourage" if (exists of Exchange account 1) is true then set theAnswer to display dialog "Entourage is already configured with an email account. Are you sure you want to set up another email account?" buttons {"Yes", "No, just use Entourage"} default button {"No, just use Entourage"} with icon 2 with title "Alert!" if button returned of theAnswer is "No, just use Entourage" then display dialog "OK. Next time you can just launch Microsoft Entourage directly." buttons {"OK"} default button {"OK"} with icon 1 with title "For your information..." return -- exits the script end if end if
end tell

--------------------------------------------
-- End setup check
--------------------------------------------

--------------------------------------------
-- Begin account setup
--------------------------------------------

try

set verifyEmail to display dialog "Please verify that your email address is correct." default answer emailAddress with icon 2 buttons {"Cancel", "OK"} default button {"OK"} set emailAddress to text returned of verifyEmail

set verifyServer to display dialog "Please verify that your Exchange Server name is correct." default answer ExchangeServer with icon 2 buttons {"Cancel", "OK"} default button {"OK"} set ExchangeServer to text returned of verifyServer

tell application "Microsoft Entourage" activate set newExchangeAccount to make new Exchange account with properties {name:"Mailbox - " & fullName, Exchange ID:shortName, domain:WindowsDomain, full name:fullName, email address:emailAddress, search base:LDAPSearchBase, Exchange server settings:{address:ExchangeServer, requires SSL:ExchangeServerSSL, port:ExchangeServerSSLPort}, public folder server settings:{address:PublicFolderServer, requires SSL:PublicFolderServerSSL, port:PublicFolderServerSSLPort}, LDAP server settings:{address:LDAPServer, LDAP requires authentication:LDAPRequiresAuthentication, requires SSL:LDAPServerSSL, port:LDAPServerSSLPort, maximum entries:LDAPMaximumResults}}

-- This line corrects a bug in Entourage 2008 where the SSL setting for the LDAP server -- will always be enabled. The property chosen above will be honored.

set LDAP requires authentication of newExchangeAccount to LDAPRequiresAuthentication

-- The following lines enable Kerberos support only if Entourage 2008 is installed -- and the userKerberos property above is set to true.

if version contains "12" and useKerberos is true then set requires Kerberos of newExchangeAccount to useKerberos set principal of newExchangeAccount to useKerberos end if

try close window "Entourage Setup Assistant" end try

set enabled of schedule "Send & Receive All" to scheduled

end tell

on error

display dialog errorMessage with icon 2 buttons {"OK"} default button {"OK"}

end try

Cem
Valued Contributor

Got it! I have posted the solution in jamfnation link below.

https://www.jamfnation.com/discussion.html?id=74

Thanks!
Cem

nessts
Valued Contributor II

is this list dying and some other webpage based list the solution?

-- Todd Ness
Technology Consultant/Non-Windows Services
Americas Regional Delivery Engineering
HP Enterprise Services
/854A2179-8596-47BF-AD43-6E291368E743/todd.ness at hp.com>
5268 E. 118th Pl. Thornton, CO 80233

Cem
Valued Contributor

I think the idea to use the jamfnation.com should be the way forward. But
I kind of like the way how dynamic this mailing list is...

I only use jamfnation if I have a solution (scripts etc...) to show. So it
is easy to locate, instead of going through emails.

Cem Baykara Mac Lead - Client Engineering, Workplace Technologies
Certified Casper Administrator

British Sky Broadcasting

cem.baykara at bskyb.com <mailto:your.name at bskyb.com>
Desk: +44 (0)207 990 2183 | Mobile: +44 (0)78 2558 4809

<http://skyintranet/Technology/Departments/Customer-Information-Systems/Op
erations-Engineering/>