jagreygoose

Profile Manager Remote Export

Oct 18th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.13 KB | None | 0 0
  1. #!/bin/sh
  2. DATABASE=devicemgr_v2m0
  3. USERNAME=_devicemgr
  4. HOSTNAME=/Library/Server/ProfileManager/Config/var/PostgreSQL
  5.  
  6.  
  7. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY devices TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/devices.csv
  8. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY device_groups TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/device_groups.csv
  9. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY device_group_memberships TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/device_group_memberships.csv
  10. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY device_groups_devices TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/device_groups_devices.csv
  11.  
  12.  
  13. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY users TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/users.csv
  14. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY user_groups TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/user_groups.csv
  15. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY device_group_memberships TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/user_group_memberships.csv
  16. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY device_group_memberships TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/user_groups_users.csv
  17.  
  18. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY installed_ios_applications TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/installed_ios_applications.csv
  19.  
  20. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY edu_classes TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/edu_classes.csv
  21. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY edu_classes_library_items TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/edu_classes_library_items.csv
  22. psql -h $HOSTNAME -U $USERNAME -d $DATABASE -c "COPY edu_devices_users TO STDOUT WITH CSV HEADER " > /Volumes/Adsoft/student_db_export/profilemanager/edu_devices_users.csv
Advertisement
Add Comment
Please, Sign In to add comment