Posted on 06-09-2016 10:36 AM
I am trying to disable these sidebar items with a config profile:
domain: com.apple.sidebarlists
user level
<?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>networkbrowser</key>
<dict>
<key>CustomListProperties</key>
<dict>
<key>com.apple.NetworkBrowser.backToMyMacEnabled</key>
<false/>
<key>com.apple.NetworkBrowser.bonjourEnabled</key>
<false/>
</dict>
</dict>
</dict>
</plist>
does not work at ALL!
Posted on 06-09-2016 10:50 AM
Does running this command, then reloading the profile, help?:
sudo killall cfprefsd
Posted on 06-09-2016 10:54 AM
i did a killall cfprefsd and restarted the finder.
Posted on 06-10-2016 05:31 AM
I abandoned the cfg profile because they give me headaches and instead am using a script to modify the sidebar. I made a plistbuddy command but the problem is that com.apple.sidebarlists does not get born until you modify the defaults, which it inherits from ... somewhere ... The if [ -e is so when I finally use this, only newly imaged machines will have the script run. I am distributing mysides at imaging time, and this is for new builds only. I used sfltool because I wanted to get familiar with it. the mysides lines I copied from another thread here.
#!/bin/bash
# Get the Username of the currently logged user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
if [ -e /usr/local/bin/mysides ]
then
su - "$loggedInUser" -c "/usr/local/bin/mysides remove All My Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/" && sleep 2
su - "$loggedInUser" -c "/usr/local/bin/mysides remove iCloud x-apple-finder:icloud" && sleep 2
su - "$loggedInUser" -c "/usr/local/bin/mysides remove domain-AirDrop nwnode://domain-AirDrop" && sleep 2
su - "$loggedInUser" -c "/usr/local/bin/mysides remove domain-Bonjour nwnode://domain-Bonjour" && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Desktop && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Documents && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Downloads && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Movies && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Music && sleep 2
/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$loggedInUser/Pictures && sleep 2
touch /Users/$loggedInUser/.sidebarshortcuts
fi
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.bonjourEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
Maybe I just need to sleep after the touch command?
Posted on 06-10-2016 05:46 AM
Ok that works, but doesn't seem to take effect until after a reboot?
Posted on 06-10-2016 06:00 AM
@djdavetrouble have you scene this thread?
Posted on 06-10-2016 06:30 AM
Hey, it totally works! the check boxes remain unchanged on backtomymac and bonjour until a full reboot. I am working on that now. I have seen that thread, seems a little dated. Anyway, the cfg profile didn't work and this does.
Posted on 08-09-2016 06:18 AM
Hope you don't mind, but I'm using your script and it works great, but no matter what I try I simply cannot get any of the Network Browser stuff to hide. I don't want my users seeing any of it; Back To My Mac, Bonjour or Connected Servers, the script is writing to the plists fine, it just ignores the settings though. Any ideas?
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled bool False" /home/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.connectedEnabled bool False" /home/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.bonjourEnabled bool False" /home/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
Posted on 09-06-2016 06:32 AM
I trigger as login, when are you running the script?
Posted on 01-18-2017 07:48 AM
@djdavetrouble Also at login.