You could create a new script to call the Policies.
so you have 1 script to install your team view, called in it's own policy.
then another script to run the teamviewer enrollment in it's own policy
set both of those as available in self service,
then create a new script with it's own policy - this script first calls the install script policy, then it calls the teamviewer enrollment/user policy., once the previous script has returned an exit of 0
that's what I'd likely do in your scenario - likely others have a better method?
If you’re not using the “Files and Processes” payload, you can always provide a custom event trigger then use “Execute Command” field in the files and processes to call another policy using your custom trigger. Ie:
1. Policy 1 runs with script
2. policy calls “sudo jamf policy -event customPolicyTrigger2” via the Files and Processes payloads.
3. Policy 2 runs with script
4. policy calls “sudo jamf policy -event customPolicyTrigger3” via the Files and Processes payloads.
5. Etc etc
All good suggestions. You can also just run two scripts in the same policy. Scripts run in alphabetical order. So name your scripts like:
1-InstallTeamViewer
2-ActivateTeamViewer
Just to add security, make the install script a "Before" script and the activation an "After" script.
Looking at this slightly differently - if you increase that sleep 60 to sleep 300 does it always work?
Your script looks similar to the last one in this POST, maybe try that one see if it works.
*Please post script by selecting "Insert/Edit code sample" option instead of picture. It's easier to read.
Looking at this slightly differently - if you increase that sleep 60 to sleep 300 does it always work?
still the same, increase it to 500 from 60seconds and still doesnt work