Hello, I have been tasked with disabling Outlook 2011 autodiscover for our department and when I create the custom fixlet it fails on all of the machines I have been testing it on. The Applescript is:
tell application “Microsoft Outlook”
set background autodiscover of exchange account 1 to false
end tell
I have tested this on my Mac using the Applescript editor and it works correctly.
This seems like this would not work unless Outlook was already open on the target machine. Also, since BigFix / IEM actions happen as “root” and not as the current user, then it would probably be changing the setting for “root” and not the current user, if it is a per user setting.
Is this a per user setting or a machine level setting?
This applescript will not work through BigFix/IEM unless you can “run as current user” which would only change the setting for the currently logged on user. If you can manage this setting through MCX, then you should be able to deliver the MCX through BigFix/IEM.
I have tested it on target machines with Outlook open and closed and it fails on both. We do not have the root user account enabled on any of our machines either. This will be a machine level setting.
This is not a machine level setting, it is a per user setting. This will never work directly through BigFix/IEM. I’m not sure how ‘runascurrentuser’ works on the mac, but if there is such a thing, then you could run the applescript on the command line using ‘runascurrentuser’ if and only if there is a user logged on and they have outlook already open.
You need to run this, as the current user: /usr/bin/osascript -e ‘tell application “Microsoft Outlook” to set background autodiscover of exchange account 1 to false’
You would need the following relevance, in addition to checking that outlook is open: exists current user whose(name of it != “root”)
That would not work because it is still running as root, it need to “run as current user” which requires something else to be run first to make that happen. I am only used to doing so on the PC, not the Mac.
This is something that would be much better done through the use of MCX to manage the per-user setting. I have not done so, but I’m fairly confident you could manage MCX through BigFix/IEM.
The other option would be to impersonate the current user like this: