Skip to main content
Question

Setting EA to detect Domain

  • August 16, 2023
  • 1 reply
  • 0 views

Forum|alt.badge.img+8

I'm trying to create an EA to show when the device is added to domain, so then I can make a smart group based off of that.

 

The script I'm trying to use is:

#!/bin/bash
domainName=`echo show com.apple.opendirectoryd.ActiveDirectory |
scutil | grep DomainNameFlat | awk '{print $3}'`

echo "$domainName "

 

When I run that in terminal, it gives me the result that I expect, but when I use that script as an EA, none of my devices are reporting in that field yet.

1 reply

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7881 replies
  • August 16, 2023

This is already a built in piece of criteria, called "Active Directory Status" Maybe I'm missing something, but why are you trying to create your own EA for this? Though the built in one returns in the format of domain.company.com, not just "domain" like yours does.

But to answer your question, all Extension Attributes need to echo or print the result back between <result></result> tags, so your last line in the EA script should be echo "<result>$domainName</result>"


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings