How to export device data from Profile Manager

I've been searching for a good psql-recipe to export the device data in Profile Manager, when my coding colleague more or less solved it in a minut with a one-liner. I justed forgot to ask him. Here you go:



psql -h /Library/Server/ProfileManager/Config/var/PostgreSQL -U _devicemgr -d devicemgr_v2m0 -c "select \"DeviceName\",\"SerialNumber\",\"WiFiMAC\" from devices where mdm_target_type = 'ios';"


or maybe

psql -h /Library/Server/ProfileManager/Config/var/PostgreSQL -U _devicemgr -d devicemgr_v2m0 -c "select \"DeviceName\",\"SerialNumber\",\"WiFiMAC\" from devices where mdm_target_type = 'ios';" > ~/Desktop/devices.txt


to get a file.



This command can be run on the live database, so no need to make an backup before you start digging into it.

Posted on Oct 15, 2015 4:59 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to export device data from Profile Manager

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.