One Drive for Business Client is here!!

BOBW
Contributor II

Just thought you all might like to know it is finally here:

https://support.office.com/en-us/article/Get-started-with-the-OneDrive-for-Business-Next-Generation-Sync-Client-on-Mac-OS-X-d11b9f29-00bb-4172-be39-997da46f913f?ui=en-US&rs=en-US&ad=US

https://support.office.com/en-us/article/Get-started-with-the-OneDrive-for-Business-Next-Generation-Sync-Client-on-Mac-OS-X-d11b9f29-00bb-4172-be39-997da46f913f

make sure you run those commands as in website:
defaults write com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True

Download App from app store, fix Mas_reciept, drop into composer, grab the plist from :
/Users/*/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist

FUT, FEU

and away you go!!

59 REPLIES 59

emilh
New Contributor III

Finally!

Ran into a problem pretty much straight away though; seems like they can't handle umlauts in the organization name. Got a lovely u00f6 instead of an ö in the sync folder name.

fritz_schlapbac
Contributor

Nice. But unfortunately (and to be honest I'm not really surprised) it does not support connecting to on-premises SharePoints. To add this feature it will take another year I guess. Would have been a nice Christmas present.

jhuls
Contributor III

New to deploying from app store...what do you mean by fix Mas_receipt?

ooshnoo
Valued Contributor

Sorry. but this is not new. It's been available since late September

BOBW
Contributor II

@ooshnoo Funny that, when you go to app store it shows updated 17th December....

@jhuls Have a look at this:
https://jamfnation.jamfsoftware.com/discussion.html?id=11816

davidacland
Honored Contributor II

We had been testing this out over the past few months. The main problems were it not working (at least for us) on 10.11 and the App store version being for personal accounts only. The business version would crash immediately after logging in on El Cap.

We tested the Beta version a few weeks ago and it worked ok.

This is the first App Store version I've seen that works on 10.11 and with a business Office365 account.

mapurcel
Contributor III

Is Microsoft planning on releasing this only through the App Store does anyone know?

sparker
New Contributor II

@davidacland Had the same experience testing the before 17.3.6296 version as well. Glad to see we have a working 10.11 version

Retrac
Contributor

Anyone know how the client is setting 'Open at Login'?

The com.microsoft.OneDrive-mac plist does't change when the option to open at login is ticked.

com.microsoft.OneDrive-mac as a config profile to set DefaultToBusinessFRE and EnableAddAccounts works a treat though.

mapurcel
Contributor III

@c0up3 when you use the method of fixing the Mas_receipt and dropping into Composer, will future app updates work on the client machines? I'm being asked to deploy this without using personal Apple ID's - I know with Casper 9.82 and 10.11 there is device based VPP but we are not quite there yet...any suggestions out there?

BOBW
Contributor II

@mapurcel sorry for the late reply, been off on holidays :) We are looking at getting VPP kicked off so I don't have to manage the MAS_Receipt files, but as far as I know it should never prompt for a update when using a blank MAS_Receipt file, anyone correct me if I am wrong. I force all App store updates to all machines when they come out at this time.

I have found if I leave the updating to the staff they will never update, and not having their Apple ID/passwords I cannot force the update. So.... its either manage the apps and keep them up to date or leave it to staff who only about 10% will update themselves.

Could make a policy to force prompt users but then they would only complain about something coming up while they were working....

Mika-L
New Contributor II

I am quite new to the Composer and to the whole Mac OS X environment.

What would be the most efficient way to create a PKG with composer with i.e. shell script which applies the commands (shown below) after the installation?

defaults write com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True

I already did preliminary tests with grabbing the onedrive.app from App Store while snapshot was running and added afterwards post install script (shell) with the lines mentioned above.

I did a test install in on a fresh Mac OS X, but seems it did not apply the needed lines automatically as it still goes to the wrong log-in screen (Not for business environment)

davidacland
Honored Contributor II

Hi, it will be running the commands as root so the commands will be getting written into the wrong preference domain.

You can script to write the setting into the users home although a custom configuration profile to set these two keys might be a better route.

Mika-L
New Contributor II

Hey,

Thanks for the response. I am currently just using JAMF Composer to test it out so I don't think I am able to use custom configuration profile. Would you happen to have an example script how this would go?

bpavlov
Honored Contributor

@Xerendor There's a couple of things to note here:
1. I would avoid using a snapshot to capture Mac App Store apps. Doing this will result in you grabbing the _MASReceipt which will tie it to the Apple ID you used to download the app which means the end user will be prompted for credentials for that Apple ID when the app needs to be updated.

Instead, look at the Apple supported method of using VPP to deploy apps. Read here: https://support.apple.com/en-us/HT202995 and http://www.jamfsoftware.com/solutions/education/volume-purchase-program/

Or you can go with this method: [ttp://derflounder.wordpress.com/2013/08/22/downloading-apples-server-app-installer-package/](ttp://derflounder.wordpress.com/2013/08/22/downloading-apples-server-app-installer-package/). For most apps this method alone will work fine as there will not be a _MASReceipt and the app will launch normally. However, there are some apps which will require a _MASReceipt file and for this you can (at the moment create a dummy _MASReceipt) with a simple line like this:

touch /Applications/MyGreatProgram.app/Contents/_MASReceipt/receipt

Sure, you'll have a few people tell you that you shouldn't use this method, but to me this method is much cleaner than capturing that _MASReceipt and having confused users getting prompted for credentials. Sure, some admins tell you that they will know when the update is available and package up asap, but that doesn't cover situations where a user may not be in range of the JSS to get that latest app update pushed.

  1. User context is always key when writing scripts and using context aware commands. If you do not specify anything, "defaults" will automatically write or read from the current user's preferences. If you want to write to a specific place, then you will need to make sure that command is run as the user or specify the exact path where you want to read from/write to. However, even if you write to a specific path, be aware that the file will be written by account running the command which can lead to wrong permissions on the file.

For example, if root runs:

defaults write /Users/regularuser/Library/Preferences/com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True

then the file will be written correctly, but the permissions on the file will have the owner as root instead of "regularuser" which means the preference will never get read correctly. So you would have to include an extra command to correct ownership on the file like this:

chown "username" /Users/regularuser/Library/Preferences/com.microsoft.OneDrive-mac.plist

Another caveat to keep in mind is that certain apps that are sandboxed will have their preferences located within /Users/username/Library/Containers/........ so you really have to be aware if you are specifying a path where the app stores them as well. However, if you run the defaults command in the correct user context, it will know which preference file you are referring to and should write to it accordingly making the last two points about permissions and knowing the path kind of moot (at least the last time I've read this was the case, but I could be mistaken that it's aware of the differences between sandboxed and non-sandboxed apps).

With that all said, when possible I always attempt to use a custom configuration profile as @davidacland alluded to and only resort to the method I just previously described when only when necessary.

A custom configuration profile can be created by uploading a custom plist file to the JSS. Go to JSS > Computers > Configuration Profile > Click on "New" > Click "Custom Settings" payload > Upload PLIST.

Alternatively, you can use MCXtoProfile: https://github.com/timsutton/mcxToProfile and upload the resulting .mobileconfig file.
Go to JSS > Computers > Configuration Profile > Click on "Upload" to upload that custom config profile.

The PLIST you want to upload or that you use to create the custom config profile needs to have the exact settings you want to manage. Do not include values you do not want to manage as you may end up with less than desirable results. In other words, it will manage and force those values on the user which you won't necessarily want.

I hope this post helps you get a better understanding of your options and how to tackle them.

gachowski
Valued Contributor II

Anybody get this automated yet?

I couldn't get

"defaults write /Users/regularuser/Library/Preferences/com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True"

and I can't find where writes too...

defaults write com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True

cbrewer
Valued Contributor II

I have it working. Here's my Self Service script.

#!/bin/bash

if [ ! -d /Applications/OneDrive.app/ ];then
    echo "OneDrive app not installed"
    exit 0
fi

defaults write /Users/$3/Library/Preferences/com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write /Users/$3/Library/Preferences/com.microsoft.OneDrive-mac EnableAddAccounts -bool True
chown $3 /Users/$3/Library/Preferences/com.microsoft.OneDrive-mac.plist
open /Applications/OneDrive.app/

gachowski
Valued Contributor II

@cbrewer

Thanks for helping out!!!

I was hoping to have the preferences there before the app was installed : ) : )

C

khey
Contributor

Hi @cbrewer ,

would you please share how do you package the onedrive app? the script that you share, is that a separate policy?

thanks

cbrewer
Valued Contributor II

I didn't package the app. I purchased (they are free) managed VPP licenses for the app. If you're on Casper 9.82 you can assign device based licenses. This makes it a painless install via Self Service, at least for 10.11 Macs.

I do wish that when you deployed Mac App Store apps in Self Service you could tie in scripts and what not like with a policy. Feature request I guess...

PAC
Contributor

Hey Everyone,

Its great that @cbrewer has got it to run and install,
My next question is, has anyone got it to auto discover the login details for the user?
If they were to login into the computer which is on the domain and set up their email, Is there a way for that the OneDrive For Business will set everything up and login and they wont have to touch anything?

Cheers

stpetersgirls
New Contributor

Anybody able to get this part working? from https://support.office.com/en-us/article/Deploying-the-OneDrive-Next-Generation-Sync-Client-on-OS-X-and-configuring-work-or-school-accounts-eadddc4e-edc0-4982-9f50-2aef5038c307?ui=en-US&rs=en-US&ad=US

*Set the default location for the local "OneDrive - {tenant name}" folder

This setting allows you to set a specific path as the default location of the OneDrive folder when users configure their work or school account. If you do not enable this setting, the local "OneDrive - {tenant}" folder location will default to the user's home directory.

Because this setting is tenant-specific, you need your tenant ID. This setting is configured using a nested dictionary in the preferences plist for OneDrive.app. The outer dictionary ("Tenants") contains key/value pairs of tenant IDs (the key), and a dictionary of specific settings for that tenant (the value):

Tenants = { "{tenant ID/GUID}" = { {tenant-specific preferences} }
}
To assist with configuring this nested dictionary of settings, the following examples demonstrate how to do this using the PlistBuddy command line utility.

First, execute this command (where <TenantID> is substituted with your tenant ID):

/usr/libexec/PlistBuddy -c "Add :Tenants:<TenantID>" ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
Followed by this command:

/usr/libexec/PlistBuddy -c "Add :Tenants:<TenantID>:DefaultFolder string '<PathToFolder>'" ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
*

wmateo
Contributor

@cbrewer how are you deploying this besides self service? I am looking to have this as a package, and post install script so that my techs can deploy to users via casper remote, as well as a policy which you did with the SS approach.

cbrewer
Valued Contributor II

I'm only deploying via Self Service right now. You can try the install automatically method or you could go with this older method where you grab the installer as it comes down via App Store. My goal is to move toward device based licensing for Mac App Store apps where I can.

wmateo
Contributor

@cbrewer Thanks! I am trying your script now and it's failing at the chown command,

cbrewer
Valued Contributor II

I changed my script a bit so that it does not rely on $3. It also removes the previous OneDrive container folder which I found can clear up some issues when trying to reinstall.

#!/bin/bash

loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`

if [ ! -d /Applications/OneDrive.app/ ];then
    echo "OneDrive app not installed"
    exit 0
fi

if [ -d /Users/$loggedInUser/Library/Containers/com.microsoft.OneDrive-mac/ ];then
    rm -R /Users/$loggedInUser/Library/Containers/com.microsoft.OneDrive-mac/
    echo "Removed existing com.microsoft.OneDrive-mac container"
fi

defaults write /Users/$loggedInUser/Library/Preferences/com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write /Users/$loggedInUser/Library/Preferences/com.microsoft.OneDrive-mac EnableAddAccounts -bool True
chown $loggedInUser /Users/$loggedInUser/Library/Preferences/com.microsoft.OneDrive-mac.plist
su -l $loggedInUser -c "open /Applications/OneDrive.app/"

wmateo
Contributor

going to try it. Thanks!!

gachowski
Valued Contributor II

@cbrewer

Thank you !!! Thank you !!!!

C

wmateo
Contributor

@stpetersgirls Did you ever get this to work? I want to have a preset location for users as well instead of letting them pick their own. if you could post script or example how you accomplished this would be great. thanks!

jleomcdo
Contributor

I thought I'd add my 2 cents to this post. I'm currently working on packaging and testing the OneDrive deployment. I started out with a script that would configure the client, similar to cbrewer. Then I decided to just use Composer to package the plist file and saved it as a DMG and set FUT/FEU option. This way, if other users log in after OneDrive has been installed, they would have the same "Business Account" settings.

One thing that I haven't been able to figure out is how to enable the Finder Extension for OneDrive. (In System Preferences, Extensions) Has anyone had any luck with this?

Retrac
Contributor

Couldn't find which plist/sqlite db etc was controlling the enabled/disabled flag for OneDrive Finder Extension so went down the applescript route.

Not my preferred method but it gets the job done.

wmateo
Contributor

@Retrac would you mind posting script? I am also trying to do same thing.

Retrac
Contributor

Sure @wmateo,

This is what I am running in the Self Service policy on the after priority.

#!/bin/sh

#Get the logged in user
LoggedInUser=`who | grep console | awk '{print $1}'`
echo "Current user is $LoggedInUser"

#Get OS version to determine how to allow assistive access
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
echo "Running OS is 10.$osvers"

#Give jamfagent access to be an assistive device for osascript
if [[ "$osvers" == "11" ]];then
    sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/usr/local/jamf/bin/jamfAgent',1,1,1,NULL,NULL)"
echo "jamfAgent given access as assistive device on OSX 10.11.x"
fi

if [[ "$osvers" == "9" || "$osvers" == "10" ]]; then
    sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/usr/local/jamf/bin/jamfAgent',1,1,1,NULL)"
echo "jamfAgent given access as assistive device on OSX 10.9/10"
fi

su - $LoggedInUser -c /usr/bin/osascript <<Runit
tell application "System Preferences"
    activate
    set the current pane to pane id "com.apple.preferences.extensions"
    delay 0.5
end tell
tell application "System Events" to tell process "System Preferences"
    delay 0.5
    select row 3 of table 1 of scroll area 1 of window "Extensions"
end tell
tell application "System Events"
    tell application process "System Preferences"
        --repeat while not (rows of table 1 of scroll area 1 of group 1 of window 1 exists)
        repeat while not (window "Extensions" exists)
        end repeat
        tell window "Extensions"

            repeat while not (rows of table 1 of scroll area of group 1 exists)
            end repeat
            set the_row to "1"
            repeat with current_row in (rows of table 1 of scroll area 1 of group 1)
                if value of static text 1 of UI element 1 of current_row is equal to "OneDrive Finder Integration" then
                    --select current_row
                    if value of checkbox 1 of UI element 1 of current_row is 0 then click checkbox 1 of UI element 1 of current_row
                    --click checkbox 1 of UI element 1 of current_row is equal to "OneDrive Finder Integration"
                    exit repeat
                end if
            end repeat
        end tell
    end tell
end tell
delay 0.5
quit application "System Preferences"
Runit

echo "OneDrive Finder integration enabled"

#Remove assistive device access
sqlite3 /Library/Application Support/com.apple.TCC/TCC.db "delete from access where client='/usr/local/jamf/bin/jamfAgent';"
echo "jamfAgent assistive access removed"

exit 0

Chris
Valued Contributor
pluginkit -e use -i com.microsoft.OneDrive-mac.FinderSync

will enable the Finder extension for the current user

jleomcdo
Contributor

Chris, Thank you SO MUCH!!! I've been looking all over the web to find something like this. I even opened a call with Apple to see if they knew of a command line tool. They couldn't help.

Anyways, this is perfect. Thanks!

Aziz
Valued Contributor

Thank you @Chris!

tim_rees
Contributor

Hi All,

If anyone is interested, it appears that the preferences for OneDrive are written here:

/Users/username/Library/Group Containers/sync.com.microsoft.OneDrive-mac/Library/Preferences/sync.com.microsoft.OneDrive-mac.plist

So with this in mind, this is the script I'm putting into self service to allow my staff to configure OneDrive:

#!/bin/bash

# Define Username Variable
username=$(ls -l /dev/console | awk '{print $3}')

# If OneDrive App has not been successfully installed, the script will not run.

if [ ! -d /Applications/OneDrive.app/ ];then
    echo "OneDrive app not installed"
    exit 0
fi

# Set OneDrive Preferences
su -l $username -c "defaults write com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True"
su -l $username -c "defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True"

# Enable OneDrive Finder Extensions
pluginkit -e use -i com.microsoft.OneDrive-mac.FinderSync

# Boot OneDrive Application
su -l $username -c "open /Applications/OneDrive.app/"

Thanks to all of those who have given wisdom and help on this project!! :-)

I saw this question asked before, but I wanted to ask it again, has anyone been able to script the "open at login" option?

Thanks!
Tim

sgoetz
Contributor

Hey All,

So I ran the pluginkit command above as the user, and it does indeed check the box in Sys Pref -> Extensions. But I do not see the OneDrive folder name show up under Favorites in the Finder Sidebar. Isn't that what that Extension is for. I thought maybe it was cuase I ran the command, but I imaged a fresh machine and manually checked it and got the same result. Is there a character limit on the name that can show up in Favorites. Maybe our company is well over it. ?

Thanks for your guys/gals input!

Shawn

stpetersgirls
New Contributor

mine is pretty simple but it creates all the plists and edits them first. then just opens the app store to the one drive app for them to install. Once they open it they are directed to 365 login. For some reason this line in the script doesn't actually set the permissions properly so i placed it as Files and Commands execute command
sudo chown -f $USER ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist

!/bin/sh

touch ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
sudo chown -R $USER ~/Library/Containers/com.microsoft.OneDrive-mac/
sudo chown -f $USER ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac.plist
defaults write ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
defaults write ~/Library/Containers/com.microsoft.OneDrive-mac/Data/Library/Preferences/com.microsoft.OneDrive-mac DisablePersonalSync -bool True
open 'macappstores://itunes.apple.com/au/app/onedrive/id823766827?mt=12'