Posted on 09-12-2016 07:25 AM
I am new to Casper and I'm looking for a way to automate the enrollment process so that a new computer or one that has been re-imaged will go into the correct computer group on enrollment. A few years ago with Workgroup Manager, we would scan the MAC addresses into a computer group prior to unboxing and imaging so that they all were named correctly and went into the correct computer group once enrolled. The MAC address placeholder also ensured that after a re-image, the computer would stay in the right group, with the right name. I don't see any way in Casper to create placeholder computer records and when I reimage a previously enrolled computer and re-enroll it, it does not end up in the group that it was in prior to imaging. Is there any way to automate this process or does someone have to go in and move newly enrolled devices into the correct computer group every time?
Posted on 09-12-2016 07:51 AM
Hi. Welcome to the Casper Suite and to the forums.
So, you can pre-create computer objects in the JSS that act as stub records until a machine comes along during enrollment that matches the stub records information, like MAC address, UUID, etc. Oddly enough it was easier back in a much older version of Casper Suite to create new computers than it is now. The only way to pre-create them that I'm aware of today is through the REST API, which means using scripts most likely. To pre-create them involves making sure you have all the correct pieces of data to enter with the script command or it won't make the new record. I can't say I'm 100% familiar with everything that needs to be input to make them, so maybe someone who's doing that can chime in to clarify the exact process. I'm pretty certain its more than just the MAC address that you need to do this.
As for groups and re-imaging, computers that have been assigned to a Static Computer Group in the Casper Suite will land back in those same Static Computer Groups upon re-image and re-enrollment, as long as two things remain the same.
This won't happen for things like Smart Computer Groups because those are dynamic and based on inventory information, not hardware info.
It will also not work if the Mac record is deleted in your JSS, then re-enrolled. Doing this breaks the link between the Mac and the Static Group, so they won't land back in those groups even though its the same machine.
Outside of creating these machines in advance, another option is using a dummy receipt to drop on each Mac that can get picked up by an Extension Attribute which would put the machines into the correct Smart Groups. For example, it could be as simple as a hidden file with a text string in it, with the name of the group they should belong in. The EA (Extension Attribute) script can locate and pick up the text in this file and, based on the result, Smart Groups can be crafted to place these machines into them.
There's also Sites and assigning machines to Sites, but I would examine this carefully since as soon as you enable Sites on your JSS, you need to take into account things like access, global policies vs site based policies and so on. IOW, while Sites can help with many things, it also adds a layer of complication to the mix that some people have found not to be worth the trouble at this point in time. Sites is bound to improve in the short term to make them easier to work with.
Posted on 09-13-2016 10:47 AM
Thanks for the detailed response! I was hoping it wasn't going to be that complex to pre-create records. How is everyone else naming and grouping new Macs after enrollment then? Is it all manual or based on something that smart groups can detect? One idea I had was to use smart groups and use the serial number criteria, but adding 20-30 lines to match on a smart group would be tedious and doesn't help me to rename them either.
I tested reimaging a Mac and it does work exactly as you described. I'm not sure why it wasn't working for me the first time but I realize now that the second time I tried was after a logic board replacement. It had the same serial number but if it uses UUID like you're saying then that makes sense.
Posted on 09-13-2016 10:57 AM
Yes, if a Mac gets its logic board replaced, then the UUID changes and Casper sees it as a new computer when re-enrolled. For the record, you can always go into Casper, find the original record and change the UUID to match what the new one is before its re-imaged, save the record, then when re-imaged it will pair back up correctly and not create a new one. You just need to remember to do it of course.
As for machine naming, jeez, that's a huge topic, and you'll likely hear hundreds of different answers. Certainly, yes, many admins will simply use the Serial Number as the computer name, since it should be unique. We use a specific naming convention that is determined by the user setting up the machine after imaged, based on location, department and the user's short name (we use AD cached mobile accounts) and a final identifier at the end. But again, you're going to get lots of different ways and responses. There's no right way or even really a best practice.
In terms of grouping Macs, can you explain what type of grouping you'd like to do? It may help if we have a more specific idea on how you'd like them to get grouped after enrollment.