Skip to main content
Question

Centrify Extension Attribute

  • May 4, 2015
  • 7 replies
  • 20 views

Forum|alt.badge.img+11

Just in case anyone needs a Centrify Extension Attribute:

#!/bin/sh

mode=`adinfo | grep "CentrifyDC mode" | awk '{print $3}'`

if [ "$mode" == "connected" ]; then
    echo "<result>Connected</result>"
elif [ "$mode" == "disconnected" ]; then
    echo "<result>Disconnected</result>"
else
    echo "<result>NA</result>"
fi

7 replies

Forum|alt.badge.img+11
  • Valued Contributor
  • May 4, 2015

Works great...thanks!

Corbin


Forum|alt.badge.img+5
  • Contributor
  • June 23, 2015

@kenergy Please forgive the stupid question but how does one get this into XML format? I thought Xcode could change it from a script to a xml format but apparently it can't.

Thanks,


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • June 23, 2015

@Kyuubi Curious, but why do would need this in xml format?


Forum|alt.badge.img+5
  • Contributor
  • June 23, 2015

I copied the script and pasted it into Xcode file. Saved as a .sh and then tried to upload it. JSS said it needed to be in a xml format.


Forum|alt.badge.img+5
  • Contributor
  • June 23, 2015

How wrong am I??? Be gentle.


Forum|alt.badge.img+5
  • Contributor
  • June 23, 2015

Figured it out.. The pressure of looking stupid helped a lot. Making a new Extension Att instead of trying to upload this one. Thanks guys.


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • June 23, 2015

Oh, I see. You can create Extension Attributes directly in your JSS by going to Computer Management -> Extension Attributes, then clicking the "New" button. Change the Input Type drop down menu to Script and a new field will appear below that. Paste the shell script into that field, name it, set anything else you need for it and Save.

Edit: Glad you figured it out :)