Skip to main content
Question

Date Dropdown Menu / Extension Attribute.

  • June 11, 2015
  • 4 replies
  • 14 views

Hey,

Have any of you guys ever added a custom field where you can have one of your help desk guys enter a date?

Reason being we want to set a bunch of machines to be imaged by a certain date and have that in the JSS for inventory purposes, perhaps creating a smart group for when they pass that date.

Any help much appreciated!

4 replies

acodega
Forum|alt.badge.img+15
  • Valued Contributor
  • June 11, 2015

Do you want the tech to be asked to enter the date of imaging and then put it somewhere on the Mac? You can ask them using CocoaDialog and a bash script. Then, read that entry with a script to make an extension attribute.


Forum|alt.badge.img+18
  • Valued Contributor
  • June 11, 2015

or just have a script that writes the date to a plist, then read the plist for an EA to report on.


karthikeyan_mac
Forum|alt.badge.img+18

Hi,

We use the below commands in the First Boot script to write plist in /Library/Preferences and get the inventory through Extension Attribute.

echo Creating /Library/Preferences/com.xxxxxx.SDI with latest SDI information
date=`date +%m-%d-%y_%H:%M:%S`
serial=$(system_profiler|grep "Serial Number (system)"|awk '{print $4}')
version=$"XXXXXXXX"

# Create and set the SDI.plist
defaults write /Library/Preferences/com.xxxxxx.SDI InstalledDate $date
defaults write /Library/Preferences/com.xxxxxx.SDI SerialNumber $serial
defaults write /Library/Preferences/com.xxxxxx.SDI Version $version

Thanks & Regards,
Karthikeyan M


  • June 18, 2015

Thanks for all these! @adamcodega @nessts @karthikeyan.mac you rock!