Skip to main content
Question

Need Help creating EA to get MAU Caching Server Address

  • September 16, 2017
  • 5 replies
  • 15 views

Forum|alt.badge.img+16
  • Valued Contributor
  • 119 replies

Hi Admins,

Is this correct or no? Need a little help please, Thanks in advance.

#!/bin/sh
MAUServer=`defaults read /Users/$USER/Library/Preferences/com.microsoft.autoupdate2 UpdateCache`

echo "<result>$MAUServer</result>"

5 replies

Forum|alt.badge.img+13
  • Honored Contributor
  • 550 replies
  • September 17, 2017

@Eigger looks good, got expected results on my test system,how do you have $USER variable defined?

L


Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • September 17, 2017

Here is a quick Python ObjC script that can be used to read the value of any plist file

#!/usr/bin/python

from CoreFoundation import CFPreferencesCopyAppValue
from SystemConfiguration import SCDynamicStoreCopyConsoleUser
from Foundation import NSHomeDirectoryForUser



currentuser, uid, gid = SCDynamicStoreCopyConsoleUser(None, None, None)
user_home_folder = NSHomeDirectoryForUser(currentuser)
plist_file = 'com.microsoft.autoupdate2'
key = 'UpdateCache'
domain = str('%s' + '/Library/Preferences/' + '%s') % (user_home_folder, plist_file)


value = CFPreferencesCopyAppValue(key, domain)

print '<result>%s</result>' % value

To reuse this just replace the values in plist_file and the key you are looking to get. I don't have that setting in my MS Office setup, but I was able to pull other keys out of it.


talkingmoose
Forum|alt.badge.img+36
  • Community Manager
  • 1913 replies
  • September 17, 2017

A Microsoft AutoUpdate (MAU) caching server address is one of those settings you probably want to enforce. I have plists here for different MAU settings that you can upload to your JSS and push to your Macs as configuration profiles.

https://github.com/talkingmoose/Microsoft-Office-2016-for-Mac-Management/tree/master/AutoUpdate


donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • 4293 replies
  • September 18, 2017

Definitely something you'd want to manage at the Computer Level using a Configuration Profile.

Suite-Wide Preferences | MGMT200


Forum|alt.badge.img+16
  • Author
  • Valued Contributor
  • 119 replies
  • September 18, 2017

@LSinNY I use the following to get the $USER

#!/bin/bash
#EA for MAU Caching Server Address
USER=ls -l /dev/console | awk '{print $3}'
String=`defaults read /Users/$USER/Library/Preferences/com.microsoft.autoupdate2 UpdateCache -string "$UpdateCache"`

echo "<result>$String</result>"

@talkingmoose Yes Sir, I actually do use a lot of your config profiles over here, you are such a big help to the community, Thank you! I just need an EA for Inventory use and smartgroup.

What I noticed though is before I just use the "Files and Processes" to run the

defaults write com.microsoft.autoupdate2 UpdateCache -string http://mau.domain.com

and discovered its not working, because its being run as root. So I just scripted it and made sure the script run as the logged in user. I must have misunderstood something from the instructions.