Skip to main content
Question

Extension Attribute help with Active Directory Query

  • October 16, 2012
  • 1 reply
  • 0 views

Forum|alt.badge.img+13

Seeking assistance with creating an extension attribute that will collect the following info:
For OS X 10.8
sudo defaults read /Library/Preferences/OpenDirectory/DynamicData/Active Directory/mydomain.plist | grep host

This command returns the "last used servers" for the Global Catalog server and domain server.

Can someone guide me with the best way to achieve this with an extension attribute? Also, how can I achieve the same for OS X lion?

1 reply

Forum|alt.badge.img+13
  • Contributor
  • 159 replies
  • October 16, 2012

If your "defaults read" is correct:

#!/bin/bash

lastGC=`sudo defaults read /Library/Preferences/OpenDirectory/DynamicData/Active Directory/mydomain.plist | grep host`
[ "${lastGC}" != "" ] && { echo "<result>${lastGC}</result>"; } || { echo "<result>None</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