Centrify Extension Attribute

kenergy
Contributor

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 7

corbinmharris
Contributor

Works great...thanks!

Corbin

Kyuubi
Contributor

@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
Legendary Contributor III

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

Kyuubi
Contributor

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.

Kyuubi
Contributor

How wrong am I??? Be gentle.

Kyuubi
Contributor

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
Legendary Contributor III

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 :)