I had a script working to gather a machine's DN for building Smart Groups that was fine until Mojave dropped:
#!/bin/bash
compName=$(/usr/sbin/scutil --get ComputerName)
domain="DOMAIN"
offthegrid="Not on the Domain"
ou=$(dscl "/Active Directory/$domain/All Domains" read /Computers/${compName}$ distinguishedName | tail -1 | xargs)
if [[ $ou = "Data source (/Active Directory/DOMAIN/All Domains) is not valid." ]];
then
echo "<result>$offthegrid</result>"
else
echo "<result>$ou</result>"
fi
So far, I'm not sure what changed in Mojave with this attribute. Has anyone encountered this?