MacOS – How to remotely push “defaults write” settings to OS X server clients

macmacososx-serverpages

I have some Mac OSX machines that i'm managing with an OS X server, clients are authenticated using Active Directory (golden triangle) and i'd like to disable version control for Pages/Numbers/Keynote as it doesn't work well with user profiles stored on an SMB share,

The commands that achieve this are as follows:

defaults write com.apple.iWork.Pages ApplePersistence -bool no
defaults write com.apple.iWork.Numbers ApplePersistence -bool no
defaults write com.apple.iWork.Keynote ApplePersistence -bool no

This setting appears to be per-user

I tried to save these into a logon script file with .sh extension, I chmod+x the file to allow me to import it into OS X server but it doesn't work 🙁

There's a section in OSX server under preferences which has a load of .plist files in there but I couldnt find any good documentation on how to use it … and I can't locate the plist file for Pages itself..

Sorry for the poor description, i'm new to OS X administration in this environment

Thanks in advance

(This query is actually solved now but just FYI it was OX Mavericks 10.9.5 client and a Mac Mini running 10.9.5 with Server 3.1.2)

Best Answer

The plists for the iWork suite are stored here:

/Users/accountname/Library/Containers/com.apple.iWork.AppName/Data/Library/Preferences/com.apple.iWork.AppName.plist  

with AppName: Pages, Numbers or Keynote.
Note: If you browse the folder "Containers" with the Finder the "directories" com.apple.iWork.pages and com.apple.iWork.numbers look like files but are indeed folders with file extensions like valid Pages or Numbers files (which are packages itself). Just right-click open -> Show Package Contents to dive deeper.

One way is to edit the files manually with nano or PlistEdit Pro:

Just add the following to the respective plist files:

<key>ApplePersistence</key>
<false/>

Another way (depending on your setup) is to ssh to the machine/account and execute:

defaults write com.apple.iWork.AppName ApplePersistence -bool no