Last active
September 30, 2023 10:59
-
-
Save karthikeyan-mac/d3773a375123eba3aa628fd420fb0c47 to your computer and use it in GitHub Desktop.
JAMF EA to inventory the forceDelayedMajorSoftwareUpdates and enforcedSoftwareUpdateMajorOSDeferredInstallDelay value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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