Append Location & Department with QuickAdd ?

New Contributor II

Hello, I am going to be adding approximately 400 machines to our inventory using the QuickAdd package and wondered if there is way to populate the Location and Department fields using the package, rather than entering them by hand after the package has run.



Esteemed Contributor III

We did that back when we were on 7.31...the problem we encountered was that techs would inadvertantly install the wrong QuickAdd on a Mac, then it showed up in the wrong department. We ended up creating a Smart Computer Group in JSS, so the tech(s) would install the standard QuickAdd and record the serial, then we added it to the Smart Computer Group once deployment was done. Not sure what options there are now that the QuickAdd enrolls the Macs...


Legendary Contributor III

Not when building out a QuickAdd. No way to add that in there,
By "Location" info I assume you mean the more common items like room department and building, not the end user info, right? If so truthfully, most of that stuff can be pulled from an LDAP directory, same as the end user stuff, if your JSS is connected to one and you have your mappings correct. You'd be best off getting as much as you can from there.

But if that isn't the case, you could try the following. Make sure to do this on a copy of your QuickAdd.pkg and only run it on a test machine, since I have no idea if this would really work.

Control click on the QuickAdd.pkg bundle and navigate to Contents/Resources and open the Resources folder into a window. Drag the postflight script file into a plain text editor to open and edit it.

Between the "enrolled=$?" and "exit $enrolled" lines you can try adding something like the following-

if [ "$enrolled" == "0" ]; then
      /usr/sbin/jamf recon -building "buildng_name" -department "department_name" -room "room_name"

replacing all the stuff in quotes with your actual names.

If this works, it would enroll the device to your JSS and (if successful) perform a recon inputting those values into the machines record in the Location section. Of course the QuickAdd by itself does a recon at the end of enrollment, so I'm not sure when this would happen in relation to the one built into it. Probably after though.

I've never tried doing any of this inside a QuickAdd enrollment package though, so this could flat out fail. Test test test!

Honored Contributor

Also, if you don't feel like mucking with your QuickAdd, you can do a mass-edit in the JSS for these. Search for the machines you want (named a particular way?) and go to "Take Action On Results" and edit the department/building info.

Also, if your machines fall in specific IP ranges, you can use your Network definitions to automatically change the Department/Building based on the system's IP address.

Contributor II
Contributor II

I had a need to do this this week to get some VIP machines into a no policy, no MCX, No Profiles group and i can confirm that modding the QuickAdd between "enrolled=$?" and "exit $enrolled still works under Casper 9.

I kept it a little simpler than the script above, i just needed to move the machines at enroll to a department and i added

/usr/sbin/jamf recon -department department_name_here In between the "enrolled=$?" and "exit $enrolled.

I also made sure that any unnecessary Enrollment complete policies were unchecked.

New Contributor III

Hello, I'm on JAMF PRO 10 now and I am not able to open-up QuickAdd to view content any longer in order to modify the file to add a new department. Any other methods available? Contents/Resources is no longer an option...