Hi everyone,
I have mashed together the following script to report a managed device's current LAPS password, which is stored as an extension attribute on the JSS.
Unfortunately, when I run the script, nothing is returned (no errors either).
1#!/bin/bash23apiUser=""4apiPass=""5apiURL=$(/usr/bin/defaults read /Library/Preferences/com.jamfsoftware.jamf.plist jss_url | sed 's|/$||')6udid=$(/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/awk '/Hardware UUID:/ { print $3 }')7extAttName=""LAPS""89LAPS_Password=$(curl -s -f -u $apiUser:$apiPass -H "Accept: application/xml" $apiURL/JSSResource/computers/udid/$udid/subset/extension_attributes | xpath "//extension_attribute[name=$extAttName]" 2>&1 | awk -F'<value>|</value>' '{print $2}')1011echo $LAPS_Password
Does anyone know what may be going wrong here?