Posted on 09-16-2017 03:32 PM
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>"
Posted on 09-16-2017 05:12 PM
@Eigger looks good, got expected results on my test system,how do you have $USER variable defined?
L
Posted on 09-16-2017 06:52 PM
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.
Posted on 09-17-2017 10:03 AM
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
Posted on 09-17-2017 09:24 PM
Definitely something you'd want to manage at the Computer Level using a Configuration Profile.
Suite-Wide Preferences | MGMT200
Posted on 09-17-2017 10:08 PM
@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.