Last active
December 16, 2020 19:28
-
-
Save jps3/fe817bb567333ac23579bd5f860618cc to your computer and use it in GitHub Desktop.
Jamf 200 - Section 3 - Lesson 13 - Task 2 - Computer Extension Attribute
This file contains 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 | |
# | |
# Checks whether Guest account is enabled and echoes status in | |
# Jamf Computer Extension Attribute format. | |
# | |
# Will return Enabled or Disabled. | |
# | |
PATH=/usr/bin | |
guestEnabled="$(defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled 2>/dev/null)" | |
result="" | |
if [[ "${guestEnabled}" == "1" ]]; then | |
result="Guest Enabled" | |
else | |
result="Guest is NOT Enabled" | |
fi | |
echo "<result>${result}</result>" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment