Create collect apple ids

An administrator may need to allow his users access to the Mac App Store but might prefer they download software only under sanctioned Apple IDs. Using an extension attribute in Casper, he can compile a list of all Apple IDs used on every Mac.
When a user enters an Apple ID to access the Mac App Store, it gets stored in his Home folder in:

~/Library/Preferences/com.apple.storeagent.plist

So long as he doesn’t sign out of the Mac App Store (he’ll probably just quit when he’s done) the ID remains in the file. Multiple users on a machine may use multiple Apple IDs because the credentials are stored for each user rather than once for the computer.

The following script gathers a list of unique Apple IDs from all user accounts and then returns the list to the Casper JSS as an extension attribute.

To add the following script as an extension attribute in the JSS:




Navigate to Settings tab –> Inventory Options –> Inventory Collection Preferences –> Extension Attributes tab –> Add Extension Attribute.
Name this Extension Attribute “Mac App Store Apple IDs”.
Set the Data Type to String.
Set the Input Type to Script and paste in the script.
Click the OK button and then Save the Extension Attribute.

http://techjournal.318.com/mac-os-x/use-casper-to-collect-mac-app-store-ids/
William Smith