I started a new role a few weeks ago and now I have about the same amount of experience of Box Drive. I found a few interesting things and thought I’d share them with you here.
(I was chatting with Trevor Sycock of Second Son Consulting and was inspired to write this.)
Box Autoupdate
Normally in a sane environment, you’d let Box Autoupdate just do it’s thing. It’s pretty good at it, doesn’t require admin rights and it runs in the background silently every four hours.
You may not work in a sane environment. So there is a undocumented (as far as I can tell) way to stop autoupdate in its tracks.
defaults write com.box.desktop.autoupdater AutoUpdateTrack -string disabled
In order: yes this does stop auto updates happening, yes this isn’t documented and no you can’t use configuration profiles to set this. Believe me I did try.
The AutoUpdateTrack can have the following settings:
- full – This forces auto updates on, like if you were a home user.
- enterprise – This setting is more uncertain. Consult your Box administrators if they have set anything.
- disabled – I think we can guess what this one does.
Box Tools
Oh Box … you were doing so well. But your Tools pkg installer needs to be run as the end user, and deploying via any kind of MDM is next to impossible.
The following script isn’t on my github at time of writing, but serves as an example. I’ll explain the finer parts after. I use this as part of a Packages project that I wrap the Tools pkg into.
The technique here is to make an empty package project with this postinstall script and the Box Tools pkg in the Additional Resources section. This is a technique I learned from Rich Trouton and much thanks are given.
#!/bin/zsh --no-rcs
# Work out which directory the pkg is operating from
currentdir=$( /usr/bin/dirname $0 )
# Work out current user. Abort install if one isn't present.
usernames=()
usernames+=( $( /usr/bin/dscl /Local/Default -list /Users uid | /usr/bin/awk '$2 >= 501 { print $1 }' | /usr/bin/grep -v -E "^(_|mfe)" ) )
/usr/bin/killall -q -9 "Box Edit"
/usr/bin/killall -q -9 BoxEditFinderExtension
/usr/bin/killall -q -9 "Box Device Trust"
/usr/bin/killall -q -9 "Box Local Com Server"
# Find and install the pkg in that folder and install as the user
for account in $usernames;
do
/bin/rm -rf /Users/$account/Library/Application\ Support/Box/Box\ Edit
/usr/bin/sudo -u ${account} /usr/sbin/installer -verboseR -target CurrentUserHomeDirectory -pkg "$( /usr/bin/find $currentdir -maxdepth 1 \( -iname \*\.pkg -o -iname \*\.mpkg \) )"
done
exit 0
The script looks to see where it’s current working folder is. It then interrogates the local directory for all users with a UID above 500 but excluding any with a _ in the name or any account called mfe. (The old hands will know what I’m dealing with here.)
Once we have all the accounts that we will end up processing, force kill silently all the known Box Tools processes. Then there is a zsh loop over all the user accounts, that runs installer as that user and installs Box Tools. There’s an extra change on the target switch: we’re telling it to install in that user’s home folder as per Box’s documentation.
Microsoft Office
Yes I know Box doesn’t make Office! But you can get it to integrate with Office open menu as a managed storage account.
A configuration profile scoped for com.microsoft.office and containing the following:
<key>OfficePrePopulatedThirdPartyCloudStorageProviders</key>
<array>
<dict>
<key>CSPServiceID</key>
<string>TP_BOX_2</string>
</dict>
</array>
That will neatly put Box into Microsoft Office open menu.
I hope that helps a few people out. I’m still learning the ropes on this application but making headway finally.