Adding Attribute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
05-17-2019
04:38 AM
- last edited on
03-04-2025
06:17 AM
by
kh-richa_mig
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?
- Labels:
-
Jamf Pro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>/"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-17-2019 10:50 AM
Thank you! Would you know how to configure this for attributes with dial_in enabled?
