setup-your-mac / Setup-Your-Mac

Setup Your Mac aims to simplify initial device configuration by leveraging swiftDialog and Jamf Pro Policy Custom Events to allow end-users to self-complete Mac setup post-enrollment.
https://snelson.us/sym
MIT License
246 stars 54 forks source link

Added a potentialAction to the Teams Actioncard #30

Closed colorenz closed 1 year ago

colorenz commented 1 year ago

Added a potentialAction to the Teams Actioncard and also the Hostname as Computername

image

dan-snelson commented 1 year ago

@colorenz!

Headed to lunch; will review before my afternoon nap.

colorenz commented 1 year ago

bon appétit

robjschroeder commented 1 year ago

I have been able to do something similar with my card. I have the URL to the device under the 'Mac Enrollment' title. To do this I had to have a configuration profile deployed to the computer that would get the $JSSID. Then I read that ID number in my SYM script to put together a full URL. Not sure we can do this without the added configuration profile from Jamf without having to include an API call in SYM.

colorenz commented 1 year ago

Nice. Yeah i have also such a profile on my macs🤣.

But i think not many admins use such profiles, so that was the best solution I figured out.

Or is there any other place on the device were we can find the Device ID?

dan-snelson commented 1 year ago

Seems like more and more Mac Admins are running an initial recon as the first policyJSON > listitem, which returns computer_id.

dan-snelson commented 1 year ago

@colorenz: Please pardon my lack o' git wizardry; there are now conflicts.

Will you please re-submit after having pulled 1.10.0-rc17 ?

iDrewbs commented 1 year ago

@colorenz what is that screenshot from?

robjschroeder commented 1 year ago

@dan-snelson should there be a recon inside the function then to grab the id to build the action card's uri? This would help in case an admin doesn't have a recon as first policy but still wanted to use the Teams webhook. If I get some time tonight I can try this out.

robjschroeder commented 1 year ago

Looks like we can add

id=$(jamf recon | grep '<computer_id>' | xmllint --xpath xmllint --xpath '/computer_id/text()' -)

to the function. This will grab the id and the URL can be made, then referenced in the action card.

@colorenz I can do a new PR to add this unless you want to take care of it, just let me know.

colorenz commented 1 year ago

Please make the PR. I am sleeping😅 it's 5 a.m in Germany. Thank you.

Or you need to wait.

robjschroeder commented 1 year ago

Done @dan-snelson PR #32. Enjoy your sleep @colorenz !!

dan-snelson commented 1 year ago

Thanks, @robjschroeder.

@colorenz: Should this PR now be closed? (I do want to be certain to recognize your contribution.)