Posted on 05-17-2019 08:37 AM
I was just wondering if there is a way to print the output of the sw_vers commend into a popup windows when it's run in Self Services?
Solved! Go to Solution.
Posted on 05-17-2019 09:39 AM
To go several steps further, you could look at implementing the script detailed on this thread.
Posted on 05-19-2019 02:38 AM
@meexiong
Something like this?
You can pretty much display anything with jamfHelper. To see all your option check out the help page.
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help
#protip...Making the description a variable also allows you to print it out in multiple lines.
#!/bin/bash
#variables to change jamfHelper
jamfHelper_title="Your IT Department"
jamfHelper_desc="About your macOS Version"
system_info_icon="/Applications/Utilities/System Information.app/Contents/Resources/ASP.icns"
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
sw_vers_full=`sw_vers`
# separate the elements into indvidual variables
sw_vers_ProductName=`echo "$sw_vers_full" | grep ProductName | awk -F ": " '{ print $2 }'`
sw_vers_ProductVersion=`echo "$sw_vers_full" | grep ProductVersion | awk -F ": " '{ print $2 }'`
sw_vers_BuildVersion=`echo "$sw_vers_full" | grep BuildVersion | awk -F ": " '{ print $2 }'`
# output to script retults to policy log
echo ProductName is "$sw_vers_ProductName"
echo ProductVersion is "$sw_vers_ProductVersion"
echo BuildVersion "$sw_vers_BuildVersion"
#create the message for jamfHelper
about_your_mac_details="ProductName: $sw_vers_ProductName
ProductVersion: $sw_vers_ProductVersion
BuildVersion: $sw_vers_BuildVersion"
#display jamfHelper window with & to have it exit quickly
"$jamfHelper" -windowType hud -icon "$system_info_icon" -heading "$jamfHelper_desc" -title "$jamfHelper_title" -description "$about_your_mac_details" -button1 "OK" &
Posted on 05-17-2019 09:39 AM
To go several steps further, you could look at implementing the script detailed on this thread.
Posted on 05-17-2019 09:39 AM
@meexiong Running sw_vers | grep ProductVersion | cut -d':' -f2 can get you what you need.. what are you looking to do?
Posted on 05-17-2019 12:06 PM
Hello I'm actually looking for something like what @mm2270 post.
Thanks,
Posted on 05-17-2019 12:15 PM
@meexiong I was going to recommend something like that. It's in our environment.
Posted on 05-19-2019 02:38 AM
@meexiong
Something like this?
You can pretty much display anything with jamfHelper. To see all your option check out the help page.
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help
#protip...Making the description a variable also allows you to print it out in multiple lines.
#!/bin/bash
#variables to change jamfHelper
jamfHelper_title="Your IT Department"
jamfHelper_desc="About your macOS Version"
system_info_icon="/Applications/Utilities/System Information.app/Contents/Resources/ASP.icns"
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
sw_vers_full=`sw_vers`
# separate the elements into indvidual variables
sw_vers_ProductName=`echo "$sw_vers_full" | grep ProductName | awk -F ": " '{ print $2 }'`
sw_vers_ProductVersion=`echo "$sw_vers_full" | grep ProductVersion | awk -F ": " '{ print $2 }'`
sw_vers_BuildVersion=`echo "$sw_vers_full" | grep BuildVersion | awk -F ": " '{ print $2 }'`
# output to script retults to policy log
echo ProductName is "$sw_vers_ProductName"
echo ProductVersion is "$sw_vers_ProductVersion"
echo BuildVersion "$sw_vers_BuildVersion"
#create the message for jamfHelper
about_your_mac_details="ProductName: $sw_vers_ProductName
ProductVersion: $sw_vers_ProductVersion
BuildVersion: $sw_vers_BuildVersion"
#display jamfHelper window with & to have it exit quickly
"$jamfHelper" -windowType hud -icon "$system_info_icon" -heading "$jamfHelper_desc" -title "$jamfHelper_title" -description "$about_your_mac_details" -button1 "OK" &
Posted on 05-20-2019 06:20 AM
@cubandave That is very cool. I'll give that a shot as well. Thank You everyone for helping me or point me to the right direction.