Saving this so I don't lose it. Quick and dirty check for AD site name.
Tested on 10.11 and 10.12
#!/bin/bash | |
[ $EUID -ne 0 ] && { echo "$0 must be run as root"; exit 1; } | |
AD_Forest=$(dscl localhost -list "/Active Directory") | |
AD_SiteName=$(/usr/libexec/PlistBuddy -c "print ActiveDirectory:sitename" "/Library/Preferences/OpenDirectory/DynamicData/Active Directory/${AD_Forest}.plist") | |
echo ${AD_SiteName} |
Working in Monterey, 12.5 beta2