Posted on 04-18-2022 01:03 AM
Hi All,
I have a script that i use to mass deploy teamviewer host using Jamf.
The only problem with my script is that it sometimes do not do the account assignment and enrollment of teamviewer host (last lines of my script).
I was thinking maybe i can set it up so that when my teamviewer policy finish run, Jamf can call/run another script that basically kick the last lines of code/teamviewer enrollment.
Does anyone be able to guide me on how to do this? How can i call another policy/script upon finish off running a policy/script?
Posted on 04-18-2022 03:49 AM
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?
Posted on 04-18-2022 08:33 AM
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
Posted on 04-18-2022 08:51 AM
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.
Posted on 04-19-2022 12:44 AM
Looking at this slightly differently - if you increase that sleep 60 to sleep 300 does it always work?
Posted on 05-15-2022 12:04 AM
still the same, increase it to 500 from 60seconds and still doesnt work
Posted on 04-19-2022 05:51 AM
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.