New to Jamf - DEPNotify

jearley
New Contributor III

Hi all,

I have recently been brought on to my organization and am working with Jamf Pro for the first time. I've tried coming through the posts to look for topics that would help clarify things for me on issues that we're having, but I just cannot seem to find the answer.

Problem:

All of our new MacOS devices with 12.3 or newer do not automatically launch DEPNotify, older MacOS devices such as 12.2 will automatically launch the package and begin the configuration process. From what I have read, there may need to be some verbiage changed in the scripting process or potentially another package? I could use some help getting pointed in the right direction.

 

Thanks for any help and feedback on this.

2 ACCEPTED SOLUTIONS

afnpw
New Contributor III

This is probably due to python being removed starting macOS 12.3 - I'm assuming the DEPNotify script you are using has a few lines in python. 

The link below will go over what to use the one line of python in DEPNotify.

https://scriptingosx.com/2020/02/getting-the-current-user-in-macos-update/

View solution in original post

sdagley
Esteemed Contributor II

@jearley  In addition to the comments from @afnpw regarding the removal of Python 2 from macOS 12.3 and later you might want to make sure you're using the most recent release of DEPNotify which is 1.1.6 and can be found at https://gitlab.com/Mactroll/DEPNotify/-/releases You don't mention if your configuration script  is based on the DEPNotify-Starter script which is currently at version 2.0.7 https://github.com/jamf/DEPNotify-Starter/releases/tag/v2.0.7

View solution in original post

8 REPLIES 8

afnpw
New Contributor III

This is probably due to python being removed starting macOS 12.3 - I'm assuming the DEPNotify script you are using has a few lines in python. 

The link below will go over what to use the one line of python in DEPNotify.

https://scriptingosx.com/2020/02/getting-the-current-user-in-macos-update/

jearley
New Contributor III

Thanks for sharing this, I'll be changing some things around and testing it out when I get the opportunity.

sdagley
Esteemed Contributor II

@jearley  In addition to the comments from @afnpw regarding the removal of Python 2 from macOS 12.3 and later you might want to make sure you're using the most recent release of DEPNotify which is 1.1.6 and can be found at https://gitlab.com/Mactroll/DEPNotify/-/releases You don't mention if your configuration script  is based on the DEPNotify-Starter script which is currently at version 2.0.7 https://github.com/jamf/DEPNotify-Starter/releases/tag/v2.0.7

jearley
New Contributor III

Thank you, I'm picking up where another administrator had left off. I saw where DEPNotify 1.1.6 was being used. I believe it is based on the DEPNotify-Starter script and I think that's where I'll start.

jearley
New Contributor III

Thanks for the help everyone. Based on what I'm seeing in my DEPNotify-Start scripts, I think the python line is the issue.

Old script:
# After the Apple Setup completed. Now safe to grab the current user.
  CURRENT_USER=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
  echo "$(date "+%a %h %d %H:%M:%S"): Current user set to $CURRENT_USER." >> "$DEP_NOTIFY_DEBUG"

New script:
# After the Apple Setup completed. Now safe to grab the current user and user ID
  CURRENT_USER=$(/usr/bin/stat -f "%Su" /dev/console)
  CURRENT_USER_ID=$(id -u $CURRENT_USER)
  echo "$(date "+%a %h %d %H:%M:%S"): Current user set to $CURRENT_USER (id: $CURRENT_USER_ID)." >> "$DEP_NOTIFY_DEBUG"

I haven't tested this yet, but based on the feedback you two have provided, I am assuming that this will clear up my issue. This may seem silly, but will the name of the package matter to the script or could I rename the DEPNotify package for 1.1.6 something different and it still be targeted?

jearley
New Contributor III

@sdagley or anyone who may be able to help,

I've been able to update the starter script and verify that we are using version 1.1.6 for the package. It will now automatically launch as it used to. However, when it sorts through the policy arrays it shows that it is performing the actions for each but is not actually completing the tasks. I copied the exact text that was previously used for MacOS 12.2 and older which worked, but it does not seem to be working now. Could I be missing something?

Policy Array:

#########################################################################################
# Trigger to be used to call the policy
#########################################################################################
# Policies can be called be either a custom trigger or by policy id.
# Select either event, to call the policy by the custom trigger,
# or id to call the policy by id.
TRIGGER="event"


#########################################################################################
# Policy Variable to Modify
#########################################################################################
# The policy array must be formatted "Progress Bar text,customTrigger". These will be
# run in order as they appear below.
POLICY_ARRAY=(
"Renaming Computer,renamecomputer"
"Installing Google Chrome,installchrome"
"Installing Office 365 - Please be patient,installoffice"
"Setting Outlook as your default mail client,setdefaultmail"
"Setting up your dock,setdockitem"
"Updating Inventory,updateinventory"
"Installing Cisco Umbrella,installumbrella"
"Installing Cisco,installcisco"
"Installing Rapid7,installrapid7"
)

sdagley
Esteemed Contributor II

@jearley Make sure you have set the TESTING_MODE variable to false

jearley
New Contributor III

Thanks! Was able to get everything tested and working after ironing out a few scripts. I appreciate your help and feedback!