2

How to prevent all applications in a specific folder from launching on macOS? With a .mobileconfig file? Or a script?

3

Use the following configuration profile. It will block all apps within the users home folder from launching without an admin password. This can be changed to a different path if needed.

  1. Save the following to a file with the extension .mobileconfig
  2. Double Click on the file and install it in System Preferences
  3. Celebrate

<?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>PayloadIdentifier</key>
    <string>com.company.macos.blockapps</string>
    <key>PayloadRemovalDisallowed</key>
    <true/>
    <key>PayloadScope</key>
    <string>System</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>9c24d6b3-6233-4a08-a48d-9068f4f76cf0</string>
    <key>PayloadOrganization</key>
    <string>Company Name</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
    <key>PayloadDisplayName</key>
    <string>Block Apps In User Folder</string>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadType</key>
            <string>com.apple.applicationaccess.new</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>PayloadIdentifier</key>
            <string>MCXToProfile.9c24d6b3-6233-4a08-a48d-9068f4f76cf0.alacarte.customsettings.2476221c-1870-4f3e-8c52-52386029c4cf</string>
            <key>PayloadEnabled</key>
            <true/>
            <key>PayloadUUID</key>
            <string>2476221c-1870-4f3e-8c52-52386029c4cf</string>
            <key>PayloadDisplayName</key>
            <string>Blocks all apps in the ~/ directory./string>
            <key>familyControlsEnabled</key>
            <true/>
            <key>pathBlackList</key>
            <array>
                <string>~/</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

Source: https://gist.github.com/rtrouton/1475fc5785b1af9cfbf4080a2eb6696f#file-application_block-mobileconfig

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .