Skip to main content

Is there a way to search for a specific user in the Computer Usage Logs? When this batch of laptops was rolled out (before I got here), not all of them got a proper naming convention (Bob's Macbook Pro.) We have a bunch just named Macbook Pro (37) with no information on the user.

Over the last year and a half, we have fixed these as much as we can, but there are still about 150 that still aren't named correctly. This makes locating a laptop difficult when a student loses one.

Thank you!

you could use a script to change the machine name to something you can use that unique we use the MAC address this give use a clear thing to search in for jamf pro

!/bin/sh

Get the string that contains the MAC address.

getMac=$(networksetup getmacaddress en0)

Strip the relevant information out and remove the colons.

bareMac=$(echo ${getMac:18:17} | tr -d :)

Switch the MAC address to upper-case to fit in with everything else.

capsMac=$(echo $bareMac | tr '[:lower:]' '[:upper:]')

Set the names.

sudo scutil --set LocalHostName DM$capsMac
sudo scutil --set ComputerName DM$capsMac
sudo scutil --set HostName DM$capsMac


Do you use the Extension Attribute to add the Last Logged In User to your inventory? Should help identify who is using the computer.


Those are both really good suggestions. We've been trying to switch to using a unique username for the Computer Name, but the MAC address is a good idea.

I've added the Extension Attribute for Last User and I'm currently trying to make that work. :)

Thank you both!


You're welcome and good luck!


I got it all working. Thank you again!


Is their a script for this Extension Attributes?


@wjc2a The "Last User" Extension Attribute is one of the ones in the built in templates in the server. When you go to Extension Attributes, you can choose "New From Template" and then search for "Last User".