Skip to main content
Solved

macOS Version display Script


Forum|alt.badge.img+6
  • Contributor
  • 45 replies

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?

Best answer by mm2270

To go several steps further, you could look at implementing the script detailed on this thread.

View original
Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • Answer
  • May 17, 2019

To go several steps further, you could look at implementing the script detailed on this thread.


Forum|alt.badge.img+7
  • Contributor
  • 91 replies
  • May 17, 2019

@meexiong Running sw_vers | grep ProductVersion | cut -d':' -f2 can get you what you need.. what are you looking to do?


Forum|alt.badge.img+6
  • Author
  • Contributor
  • 45 replies
  • May 17, 2019

Hello I'm actually looking for something like what @mm2270 post.

Thanks,


Forum|alt.badge.img+7
  • Contributor
  • 91 replies
  • May 17, 2019

@meexiong I was going to recommend something like that. It's in our environment.


Forum|alt.badge.img+9
  • Contributor
  • 51 replies
  • May 19, 2019

@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.

script example

#!/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" &

Forum|alt.badge.img+6
  • Author
  • Contributor
  • 45 replies
  • May 20, 2019

@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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings