Skip to content

Instantly share code, notes, and snippets.

View smashism's full-sized avatar
:shipit:
ship it!

emily smashism

:shipit:
ship it!
View GitHub Profile
@smashism
smashism / com.apple.SetupAssistant.managed
Created January 27, 2025 19:08
SkipSetupItems key for macOS Apple Intelligence (macOS 15.3+)
<?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>SkipSetupItems</key>
<array>
<string>Intelligence</string>
</array>
</dict>
</plist>
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Restrictions Payload</string>
<key>PayloadIdentifier</key>
@smashism
smashism / com.apple.applicationaccess - external intelligence integration restriction
Created December 12, 2024 18:00
Payload for com.apple.applicationaccess to restrict external intelligence integrations with Apple Intelligence as of macOS 15.2
<?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>allowExternalIntelligenceIntegrations</key>
<false/>
<key>allowExternalIntelligenceIntegrationsSignIn</key>
<false/>
</dict>
</plist>
@smashism
smashism / ea-external-intelligence-integration-status.sh
Created October 25, 2024 17:58
Designed for Jamf Pro computer extension attribute configuration. Checks for presences of com.apple.siri.generativeassistentsettings in the local preferences of the logged in user and reports the status. For macOS 15.2 and later.
#!/bin/bash
# determine if current user has opted-in for Generative Assistant settings for Apple Intelligence & Siri on macOS 15.2 or later
# ekw 2024-10-24
# built at time of macOS 15.2 beta 1
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
# global check if there is a user logged in
if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then
echo "no user logged in, cannot proceed"
exit 1
fi
@smashism
smashism / force-quit-app.sh
Created August 19, 2024 14:58
Force quit apps with a Self Service policy. $4 is a custom variable for "App Name" that can be supplied per policy depending on what needs to close.
#!/bin/bash
appName="$4"
# Kill the app, if running
echo "Killing $appName app process"
killall "$appName"
exit 0
#!/bin/bash
# determine if current user has opted-in for Apple Intelligence on macOS 15.1 or later
# ekw 2024-08-07
# built at time of macOS 15.1 beta 1
# disclaimer: forward-looking statement… this may not work forever, and likely won't be needed long-term as
# MDM vendors prepare for macOS 15 support.
# this EA for jamf pro is provided as-is with no warranty (express or implied). please test!
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
@smashism
smashism / unmanage-devices-modern-auth.sh
Created April 4, 2024 16:04
Programmatically unmanage mobile devices via Jamf Pro API using bearer-auth token authentication.
#!/bin/bash
##########
# title: unmanage-devices-modern-auth.sh
# author: dr. k | @smashism on github
# date: 2024-03-28
# note: include jssIDs where specified, other server/cred details will
# prompt when run via terminal.app
# disclaimer: provided as-is with no warranty (express or implied). please test!
#
@smashism
smashism / unmanage-computers-modern-auth.sh
Last active June 3, 2024 15:44
Programmatically unmanage computers via Jamf Pro API using bearer-auth token authentication.
#!/bin/bash
##########
# title: unmanage-computers-modern-auth.sh
# author: dr. k | @smashism on github
# date: 2024-03-28
# note: include jssIDs where specified, other server/cred details will
# prompt when run via terminal.app
# disclaimer: provided as-is with no warranty (express or implied). please test!
#
@smashism
smashism / unmanage-mobile-devices.sh
Last active July 31, 2023 18:51
Automate marking mobile devices as unmanaged with the Jamf Pro Classic API
#!/bin/bash -x
deviceIDs=(
# put jssIDs here for mobile devices to remove
# ex. 12345678
0000
)
for id in "${deviceIDs[@]}"; do
/usr/bin/curl -sku "apiuser":"apipass" -X PUT -H "content-type: text/xml" "https://yourjamfpro.jamfcloud.com/JSSResource/mobiledevices/id/{$id}" -d "<mobile_device><general><managed>false</managed></general></mobile_device>"
@smashism
smashism / unmanage-computers.sh
Created July 31, 2023 18:49
Automate marking computers as unmanaged with the Jamf Pro Classic API
#!/bin/bash -x
deviceIDs=(
# put jssIDs here for computers to remove
# ex. 12345678
0000
)
for id in "${deviceIDs[@]}"; do
/usr/bin/curl -sku "apiuser":"apipass" -X PUT -H "content-type: text/xml" "https://yourjamfpro.jamfcloud.com/JSSResource/computers/id/{$id}" -d "<computer><general><remote_management><managed>false</managed></remote_management></general></computer>"