haircut / jamf-snipe-rename Goto Github PK
View Code? Open in Web Editor NEWRename Macs using data from Snipe-IT via Jamf Pro
Rename Macs using data from Snipe-IT via Jamf Pro
Firstly many thanks for writing these scripts.
I have written a similar shell script in the past which used DeployStudio as the 'source of truth' for computer names and set that as the name in Jamf and like your script fell back to using the computer serial number if no match was found. Obviously having found your script my intention is to this time around use Snipe-IT as the source of truth.
I can see you script will do the same basic requirement of setting the computer name on the computer and in Jamf Pro. I can also see it uses the same method as I used of using the jamf binary setComputerName command.
However in this case I would also like to fill in the 'Asset Tag' field in the computer record in Jamf Pro with the Asset Tag value from Snipe-IT. Clearly this is a duplication since the intent of this script is to use that value as the computer name and Jamf computer record name but this field is specifically for the Asset Tag name and filling this in also means that if for some reason the someone manages to rename the computer that value is still around in Jamf.
It turns out that the Jamf binary also has the ability to set the Jamf computer record asset tag value.
jamf recon -assetTag $asset
Whilst it is therefore a trivial change to your script for myself to add you may want to consider this.
Note: An alternative approach might be to use Jamf Pro's own API to directly write to the field and not use the Jamf binary.
Similarly receiving the TOKEN_SALT and TOKEN_PASSPHRASE as Jamf command arguments like the Token API Key would also be beneficial.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.