Posted on 03-26-2018 10:17 AM
I have a script that only runs locally - not via policy. Can anyone tell me what I'm doing wrong?
#!/bin/bash
loggedInUser=$(ls -l /dev/console | awk '{print $3}')
defaults write /Users/$loggedInUser/Library/Preferences/com.microsoft.autoupdate2.plist HowToCheck "Manual"
Posted on 03-26-2018 11:29 AM
If you want to enforce the manual check for office updates you can try a custom configuration profile.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HowToCheck</key>
<string>Manual</string>
</dict>
</plist>
Posted on 03-26-2018 01:27 PM
How are you invoking the policy?
If it runs when no one is logged in it will do nothing as $loggedInUser will be empty.
If your running it as Login or Self Service you can use $3 directly as this will contain the username that either logged in or signed into Self Service. Outside of that contect you need to ensure that there is someone logged in.