Posted on 05-17-2019 04:38 AM
I would like to include a user attribute from Active Directory to populate for my users. The attribute is not standard from other attributes collected by default from Jamf Pro. I would need the attribute to either show yes or no if the attribute is enabled. Does anyone have any insight how to implement this?
Posted on 05-17-2019 08:29 AM
I have done this for computer objects to see if the computer is a member of an AD group. Here is the extension attribute code:
#!/bin/sh
Computer_Name=$(hostname)
Machine_Domain=$(dscl /Active Directory/ -read . SubNodes | awk '{print $2}')
AD_Groups=`dscl "/Active Directory/$Machine_Domain/All Domains" -read "/Computers/$Computer_Name$" |grep memberOf`
if [[ "$AD_Groups" =~ "AD Group Name" ]]; then
echo "<result>Yes</result>"
else
echo "<result>No</result>"
fi
You can get the username and use something like dscl "domain" -read "/Users/<username>/<attribute>/"
Posted on 05-17-2019 10:50 AM
Thank you! Would you know how to configure this for attributes with dial_in enabled?