Skip to main content
Solved

Set a stored extension attribute in JSS to a variable in a script.


shMorganson
Forum|alt.badge.img+4

I have LAPS currently setup in my environment and I would like to make another script that uses the password stored in the LAPS EA for running some commands. I am having a difficult time making a variable that is set to the stored EA in JSS.

Any help would be great!

Best answer by sshort

I'm using the same method, this is what I'm using in another script that pulls the value from the EA titled "LAPS". You'd need to define the variables, as well.

LAPS="$(/usr/bin/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}')"
View original
Did this topic help you find an answer to your question?

4 replies

mark_mahabir
Forum|alt.badge.img+15

Are you using macOSLAPS? Or LAPSforMac?


shMorganson
Forum|alt.badge.img+4
  • Author
  • New Contributor
  • 3 replies
  • July 8, 2019

I am using LAPSforMac.


Forum|alt.badge.img+5
  • New Contributor
  • 23 replies
  • July 8, 2019

Why wouldn't you just run what you need to as root using JAMF?


Forum|alt.badge.img+15
  • Valued Contributor
  • 301 replies
  • Answer
  • July 8, 2019

I'm using the same method, this is what I'm using in another script that pulls the value from the EA titled "LAPS". You'd need to define the variables, as well.

LAPS="$(/usr/bin/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}')"

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings