Disabling Spotlight/Notification Center without SIP

rhoward
Contributor

Hi everyone,

Our school wants to use 100-150 laptops for exams. In the past we've disabled and hidden Spotlight/notification center from the menu bar via script, but because of SIP we get errors until we disable it. Is there a way to completely disable this without having to boot to a recovery drive for each computer? Thanks!

2 ACCEPTED SOLUTIONS

apizz
Valued Contributor

So just came up with a solution - deploy a com.apple.Spotlight.plist file as a Custom Payload in a Configuration Profile.

Basically I just copied my ~/Library/Preferences/com.apple.Spotlight.plist file and removed everything except the orderedItems array. Just tested this at the computer-level and while it may not visually indicate being disabled in the Spotlight System Preferences pane, if you try and do a spotlight search nothing should appear.

One of the "gotchas" I found was on my test machine I didn't have Xcode installed, and apparently the Developer search item does not appear in the Spotlight list unless /Applications/Xcode.app exists (per https://www.howtogeek.com/231829/how-to-disable-developer-search-results-in-spotlight-on-a-mac/)

To get around this I just manually added the dictionary at the bottom of the list with the name SOURCE. Now if Spotlight is invoked, nothing shows up.

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>orderedItems</key>
<array>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>APPLICATIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_SPOTLIGHT_SUGGESTIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_CONVERSION</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_EXPRESSION</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_DEFINITION</string>
        </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SYSTEM_PREFS</string>
    </dict>
        <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>DOCUMENTS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>DIRECTORIES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>PRESENTATIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SPREADSHEETS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>PDF</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MESSAGES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>CONTACT</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>EVENT_TODO</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>IMAGES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>BOOKMARKS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MUSIC</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MOVIES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>FONTS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_OTHER</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_WEBSEARCH</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SOURCE</string>
    </dict>
</array>
</dict>
</plist>

View solution in original post

rhoward
Contributor

@aporlebeke this worked like a charm when I deployed it individually. I had to run a quick set of commands after that made it work:

#!/bin/sh
sudo rm Library/Preferences/com.apple.Spotlight.plist
killall cfprefsd

Going to test this on a small scale deployment. I'll let everyone know how it works. Thanks!

View solution in original post

4 REPLIES 4

dpodgors
Contributor

I opened a ticket with Apple on this in April, I wanted to do almost the same thing, disable the widgets and notifications, and the response was: Hi Don,

I completed testing and verified the results with several other engineers. We're not able to identify a method to disable widgets that does not require disabling SIP. I know this is not the result we'd hoped for, but the complexity of extensions prohibits a manual solution.

I'll continue to monitor the feature request and let you know as I receive additional information. Please let me know if you have any additional questions.

Thanks

apizz
Valued Contributor

+1 for interest

apizz
Valued Contributor

So just came up with a solution - deploy a com.apple.Spotlight.plist file as a Custom Payload in a Configuration Profile.

Basically I just copied my ~/Library/Preferences/com.apple.Spotlight.plist file and removed everything except the orderedItems array. Just tested this at the computer-level and while it may not visually indicate being disabled in the Spotlight System Preferences pane, if you try and do a spotlight search nothing should appear.

One of the "gotchas" I found was on my test machine I didn't have Xcode installed, and apparently the Developer search item does not appear in the Spotlight list unless /Applications/Xcode.app exists (per https://www.howtogeek.com/231829/how-to-disable-developer-search-results-in-spotlight-on-a-mac/)

To get around this I just manually added the dictionary at the bottom of the list with the name SOURCE. Now if Spotlight is invoked, nothing shows up.

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>orderedItems</key>
<array>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>APPLICATIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_SPOTLIGHT_SUGGESTIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_CONVERSION</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_EXPRESSION</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_DEFINITION</string>
        </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SYSTEM_PREFS</string>
    </dict>
        <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>DOCUMENTS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>DIRECTORIES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>PRESENTATIONS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SPREADSHEETS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>PDF</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MESSAGES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>CONTACT</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>EVENT_TODO</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>IMAGES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>BOOKMARKS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MUSIC</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MOVIES</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>FONTS</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_OTHER</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>MENU_WEBSEARCH</string>
    </dict>
    <dict>
        <key>enabled</key>
        <false/>
        <key>name</key>
        <string>SOURCE</string>
    </dict>
</array>
</dict>
</plist>

rhoward
Contributor

@aporlebeke this worked like a charm when I deployed it individually. I had to run a quick set of commands after that made it work:

#!/bin/sh
sudo rm Library/Preferences/com.apple.Spotlight.plist
killall cfprefsd

Going to test this on a small scale deployment. I'll let everyone know how it works. Thanks!