Setting the asset tag to the match the computers name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
06-13-2018
06:49 AM
- last edited on
03-04-2025
05:19 AM
by
kh-richa_mig
Recently joined a company whose computers don't have the asset tag field named, does anyone have a script to do this?
Really don't facing manually naming each one

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 06-15-2018 04:39 AM
give this a try..
https://www.jamf.com/jamf-nation/discussions/18944/setting-ard-info-fields-dynamically-from-the-jss

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-13-2020 05:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-13-2020 06:48 AM
Since we use the barcode in the computer name which is like "Building-StaffPosition-Barcode or HS-Teacher12345" I do this:
#!/bin/sh
#1st get computer name#
COMPNAME=`/usr/sbin/scutil --get ComputerName`
#2-grab the last 5 characters#
vasset=${COMPNAME:(-5)}
#3-set the asset in JSS#
jamf recon -skipApps -skipFonts -skipPlugins -assetTag $vasset
Gabe Shackney
Princeton Public Schools
Princeton Public Schools

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2022 05:26 AM
Id also say once you have the fleet enrolled with assigned asset tag info, I'd now just dump it into the PreInventory csv so it would automatically get it going forward without any needed scripting.
Princeton Public Schools
