MCX for testing
For testing, if you want to lock down a preference via MCX, here's how to do it. (Thanks to our awesome MacOps!)
1. Find the pref. Look at the manifest file or existing pref file.
2. Create a plist file:
<?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>com.apple.Safari</key> <dict> <key>HomePage</key> <dict> <key>state</key> <string>always</string> <key>value</key> <string>http://google.com/</string> </dict> </dict> </dict> </plist>
3. Install it for the user:
sudo dscl . -mcximport /Users/[username] /path/to/that/file.plist
4. Log out/in.
When you're done, kill it with a
sudo dscl . -mcxdelete /Users/[username] com.apple.Safari Homepage
As a bonus, in the Accounts pref pane, the user will be tagged as "Managed".
Perfect for your next April Fool's joke.