Skip to content

Instantly share code, notes, and snippets.

@karthikeyan-mac
Last active September 30, 2023 10:59
Show Gist options
  • Save karthikeyan-mac/d3773a375123eba3aa628fd420fb0c47 to your computer and use it in GitHub Desktop.
Save karthikeyan-mac/d3773a375123eba3aa628fd420fb0c47 to your computer and use it in GitHub Desktop.
JAMF EA to inventory the forceDelayedMajorSoftwareUpdates and enforcedSoftwareUpdateMajorOSDeferredInstallDelay value
#!/bin/bash
# EA to inventory the forceDelayedMajorSoftwareUpdates and enforcedSoftwareUpdateMajorOSDeferredInstallDelay value
# Karthikeyan M
# 25-Sep-23
#Software Update (com.apple.applicationaccess):
forceDelayedMajorSoftwareUpdates=`osascript -l JavaScript << EOS
ObjC.import('Foundation')
ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess').objectForKey('forceDelayedMajorSoftwareUpdates'))
EOS`
delay=`osascript -l JavaScript << EOS
ObjC.import('Foundation')
ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess').objectForKey('enforcedSoftwareUpdateMajorOSDeferredInstallDelay'))
EOS`
if [[ $forceDelayedMajorSoftwareUpdates == "" ]]; then
echo "<result>Not Configured</result>"
else
echo "<result>DelayedMajorUpdates=${forceDelayedMajorSoftwareUpdates},Days=$delay</result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment