Skip to main content

It's great so far. It's helped me determine who has PGP installed, and what VMs are out there.

Scouring the admin guide, it's not really clear how to specify a custom attribute. What data am I looking for to report back?

Good example would be to know if users have chat logging turned on or off. I know in Adium doing defaults read ~/Library/Application Support/Adium 2.0/Users/Default/Logging | grep Logging | awk '{print $4}'; would return a 0 or 1. 1 being true that logging is turned on.

Can this be made as an extension attribute?

Thanks.

It seems I'm onto something. I used one of the custom attributes and copied the script and modified it to work for what I'm looking for. I am a novice at scripting. I usually have to hunt for the code I want.

Here is what I found from the screensaver attribute modified to determine logging for Adium (I make no guarantees in your environment):

#!/bin/sh
currentUser=last -1 | awk '{print $1}'

if [ -f "/usr/bin/mcxquery" ]; then result=/usr/bin/mcxquery -user "$currentUser" | grep -A 1 -w com.apple.screensaver | tail -1 | awk '{print $5}' if [ "$result" == "0" ]; then result="False" elif [ "$result" == "1" ]; then result="True" else result="Not set." fi fi

echo "<result>$result</result>"

I don't know if I need the mcxquery in that line. I left it in there and it's providing results for me as either True or False on my test machine. Can anyone else determine if this works for them?

Thanks


I pasted the wrong code into this:

#!/bin/sh
currentUser=last -1 | awk '{print $1}'

if [ -f "/usr/bin/mcxquery" ]; then result=defaults read /Users/"$currentUser"/Library/Application Support/Adium 2.0/Users/Default/Logging | grep Logging | awk '{print $4}' if [ "$result" == "0;" ]; then result="False" elif [ "$result" == "1;" ]; then result="True" else result="Not set." fi
fi

echo "<result>$result</result>"