Jamf Connect + Inventory Update

Lakshmana
New Contributor II

Hi All,

Actually due some issues in past the home folders name are incorrect for the users.I need to get the Jamf Connect Username information to be update for the user computer inventory.How to do this through a shell script

 

Eg)firstname.lastname@domain.com is the user email id.But for some reason users home folder profile is like firstname400000 this is an issue for me to update the computer inventory for each email id.So I have the jamf connect which is been authenticated for all the users.I need to fetch that details and hostname to be updated with the Computer Hardware inventory.

 

Hostname and Username who authenticated at Jamf Connect needs to be fetched and then that needs to be updated for that user email id only

1 REPLY 1

TheAngryYeti
Contributor II
Contributor II

Something like this would work to update the record Username field to the current user. Are you also looking to set the hostname/computer name and then return it?

#!/bin/sh

loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
echo $loggedInUser

jamf recon -endUsername $loggedInUser