synapsepd / MacOS-OneDrive-KFM

MacOS OneDrive Known Folder Move (KFM)
Apache License 2.0
65 stars 11 forks source link

MacOS-OneDrive-KFM (Known Folder Move)

Purpose

Microsoft OneDrive has a super great feature (for Windows) called Known Folder Move. This redirects the Desktop, Documents, and Pictures folders to your OneDrive folder. This allows you to have multiple computers stay in sync. This application brings this same functionality to MacOS through the use of SymLinks thus enabling sync between your Desktop and Documents folders and OneDrive.

Notes

Getting started

You can choose to either download a release pkg or build your own. These steps assume that you are using a release, or have already built your own pkg.

  1. Install OneDrive standalone (not the one from the AppStore).

  2. Set preferences. You can either set them with a sudo defaults write command, a .mobileconfig profile, or an MDM profile. A sample.mobileconfig file is included in this repo.

    sudo defaults write "/Library/Preferences/com.cambridgeconsultants.onedrive-kfm" EnableKFM -bool YES

    sudo defaults write "/Library/Preferences/com.cambridgeconsultants.onedrive-kfm" FixBadFileNames -bool YES

    sudo defaults write "/Library/Preferences/com.cambridgeconsultants.onedrive-kfm" TenantID "12345678-1234-1234-1234-1234567891011"

    sudo defaults write "/Library/Preferences/com.cambridgeconsultants.onedrive-kfm" OneDriveFolderName "OneDrive - Companyname"

Here is what each setting does:

  1. Install OutSet. OutSet is used to run logon/startup scripts on MacOS. This is a dependency of this application.

  2. Install the latest version of MacOS-OneDrive-KFM-X. X.pkg

Building the package

  1. Install munki-pkg and ensure it is in your path

  2. Clone this git repo

    cd ~/keep/this/here

    git clone https://github.com/synapsepd/MacOS-OneDrive-KFM.git

  3. Edit the build-info.json file to include your certificate information, or remove the cert section alltogether if you will not be signing the package.

  4. MunkiPkg will now create a new build:

    munkipkg .

Tips, Tricks, and Troubleshooting