Q: How can I export a list of devices and their info?
We have over 100 devices and it is a pain to have to go through each item indavidually, there has to be a way to export this data or connect to the server some how and query for it.
If all esle fails I can use Curl but it seems backwards to not be able to get this information easily.
Can someone please point me in the right direction.
Thnaks
Derrick
OS X Server
Posted on Dec 17, 2012 12:05 PM
OK, I am sure I am retrarded and there is a much easier way to do this but I have finally got to the DB to get access to my device list. Call it stubron but I find it stupid that Apple does not allow a simple export of a CSV files or import either for Devices or Users (if there is please let me know).
I am sure there is an easier way, but I am not that savy with permissions or user access so maybe if you can add yourself to _postgres user/group then maybe this is not needed but this is what I had to do.
In this file, /Library/Server/PostgreSQL For Server Services/Config/com.apple.postgres.plist, remove the last 2 elements in the array I believe it is -c and the other locks the port I believe with permissions of 0770. After removeing those two lines, save the file and restart the server.
Then from there you sould be able to connect by
psql -U _postgres -d device_management -h /Library/Server/PostgreSQL\ For\ Server\ Services/Socket
good luck and be carful I am only using this to pull data not input. Please let me know everything I did wrong or anything that could be easier.
Posted on Dec 18, 2012 1:35 PM