Command Line to Extension Attribute

Sims_
Contributor

I'm trying to create all of the available command line support for Enterprise Connect into Extension Attributes. How would I make the command:

"/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -p adUsername"

into an Extension Attribute?51aafe76f74544b1a33a1f34172ba8f1

1 ACCEPTED SOLUTION

donmontalvo
Esteemed Contributor III

@Chris_Hafner good catch! Looks like -P returns true, and -p returns user's LDAP name. Fixed.

--
https://donmontalvo.com

View solution in original post

6 REPLIES 6

bramstedtb
New Contributor III

This will send the result of the command straight to the Extension Attribute. There's no error checking, or making sure that Enterprise Connect is installed, but it can get you started.

#!/bin/sh

echo "<result>$(/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -P adUsername)</result>"

donmontalvo
Esteemed Contributor III

7c3bd791cd5f489da889b37162c3cd79

#!/bin/sh
if [ -e /Applications/Enterprise Connect.app ]
then
    echo "<result>$(/Applications/Enterprise Connect.app/Contents/SharedSupport/eccl -p adUsername | cut -d":" -f2 | tr -d ' ')</result>"
else
    echo "<result>NotInstalled</result>"
fi
--
https://donmontalvo.com

Chris_Hafner
Valued Contributor II

Just noticed a small thing. @donmontalvo -p instead of -P

donmontalvo
Esteemed Contributor III

@Chris_Hafner good catch! Looks like -P returns true, and -p returns user's LDAP name. Fixed.

--
https://donmontalvo.com

Chris_Hafner
Valued Contributor II

Heh, to be honest, I've stolen this whole thing for new EA's. You guys are the very best!

Sims_
Contributor

@Chris_Hafner @donmontalvo @bramstedtb Thank you everyone!