Smart Computer Groups - Partition Name

elund
New Contributor III

I set up a Smart Computer Group with the criteria Partition Name has Macintosh. I'm not getting any results even though I know there are 500+ machines that the boot drive is named Macintosh HD. What am I doing wrong?

7 REPLIES 7

mm2270
Legendary Contributor III

Because that criteria doesn't do what you think it does. If you click the little ellipses button (...) next to the criteria name, you'll see it doesn't list the actual partition names, but things like "Boot Partition"

If you want to build a Smart Group on the hard drive name, that's something different. There is no built in criteria that captures that as far as I know, so you'd need to create an Extension Attribute to capture it.

mm2270
Legendary Contributor III

Just to make this a little more helpful, here's an EA that will capture the Device or Media name of the internal boot hard drive.

#!/bin/sh

HDName=$( diskutil info / | awk -F': *' '/Media Name/{print $NF}' )

echo "<result>$HDName</result>"

elund
New Contributor III

Interesting, odd that it does not return the name. I'll be adding the EA that you wrote. Thanks for the help!!

elund
New Contributor III

I added the script you created and well over half of the of the MacBooks are reporting the drive name as "Customer". This has me stumped.

mm2270
Legendary Contributor III

That's pretty weird. I don't know why it would be grabbing a name like that. Can you remote into one of the systems where its showing up like that in the EA, and run the following? Or perhaps do it through Casper Remote?

diskutil info /

That should only be pulling information from diskutil for the boot volume. See what shows up in the output for Device / Media Name line.
You could try modifying the awk regex from Media Name to Volume Name to see if that helps.

elund
New Contributor III

Changing it to Volume Name did the trick. Thanks!

mm2270
Legendary Contributor III

OK, not sure why the other one wasn't working, but maybe there's something unique about your systems. Anyway, glad that got it working properly.