Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Need to Pull Inventory from Profile Manager

We have 125+ ipad devices in Profile manager. I'd like to export the ipad name, serial# and cellular carrier and other cellular info for all devices into a CSV or text file. I can go to the details section of each device and manually look each one up but this is to tedious.


There has got to be a way to use Profile Manager to help inventory devices, if not this needs to be a critical added feature.

OS X El Capitan (10.11.4)

Posted on May 19, 2016 7:58 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 28, 2017 9:35 AM

I have tried this but at the login I get the following error message when I enter the admin password:


psql: FATAL: Peer authentication failed for user "_devicemgr"


I thought that the password was incorrect but when I entered a different password it would say to try again. I only get the error message when I enter the admin password

4 replies
Question marked as Top-ranking reply

Sep 28, 2017 9:35 AM in response to Strontium90

I have tried this but at the login I get the following error message when I enter the admin password:


psql: FATAL: Peer authentication failed for user "_devicemgr"


I thought that the password was incorrect but when I entered a different password it would say to try again. I only get the error message when I enter the admin password

Sep 29, 2017 7:48 AM in response to Strontium90

I don't think this can work: 'sudo psql' will run the psql command with the effective and real user id '0'. This will conflict with the '-U _devicemgr' switch and the ident-based authentication in postgres will fail.

The most comfortanble way to access the database would be:


$sudo -u _devicemgr /bin/bash

$ psql -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL

May 20, 2016 4:59 AM in response to MYAMRG

This can be done. You need to query the database directly. Try this:


1: Connect to the database (do this on the server running Profile Manager)


sudo psql -U _devicemgr -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL


2: You will be prompted for your admin password. You will not see it as you type. Hit Return when complete.


3: You will be in the interactive shell and get a prompt like the following:

psql (9.3.9)

Type "help" for help.


4: Congratulations, you have connected to the database. Let’s start digging and find out what is stored in there.

5: To list the databases, use this command (that is a lower case L):

\l


6: You should see a result that looks similar to the following:

List of databases

Name | Owner | Encoding | Collate | Ctype | Access privileges

----------------+------------+----------+---------+-------+--------------------- ------

devicemgr_v2m0 | _devicemgr | UTF8 | C | C |

postgres | _devicemgr | UTF8 | C | C |

template0 | _devicemgr | UTF8 | C | C | =c/_devicemgr +

| | | | | _devicemgr=CTc/_devicemgr

template1 | _devicemgr | UTF8 | C | C | _devicemgr=CTc/_devicemgr+

| | | | | =c/_devicemgr

(4 rows)


7: The database of interest is titled devicemgr_v2m0. In order to interact with it we must select it. To select a database, use this command:

\c devicemgr_v2m0;


8: Provided you switched successfully, you should see this notification.

You are now connected to database "devicemgr_v2m0" as user "_devicemgr".


9: To view all the tables in the database, using this command:

\dt


10: From the list you will see some tables of interest. For example, devices, device_groups, vpp_products, xsan_networks, etc. To view what is stored inside these tables, use the following command:

select * from devices;


11: Change devices to another table name if you want to explore other tables.


12: Now get what you want. Here are two example queries:

select "DeviceName","SerialNumber" from devices;

select "DeviceName",last_checkin_time from devices;

13: String together the columns you want to collect to get your report.

14: Dump results to a text file.

15: When finished, quit the interactive shell with

\q

Hope this helps. Can be done. Enjoy running your reports.

Reid

Apple Consultants Network

Author - "El Capitan Server – Foundation Services"

Author - "El Capitan Server – Control & Collaboration"

Author - "El Capitan Server – Advanced Services"

:: Exclusively available in Apple's iBooks Store

Need to Pull Inventory 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.