psql -U krypted -d device_management -c "select * from public.ios_applications limit 1000 offset 0;"The above command is a standard psql command, as shown in a previous article I worked on in a previous post. But this time I’m injecting the SQL query into the psql command using the -c option. This expands to output a list of each row in the iOS_applications table. Once you see which apps have which unique id’s, you can then remove entries using their identifiers (this time we’re throwing in a delete instead of select using the -c):
psql -U krypted -d device_management -c "delete from public.ios_applications where id=2;"Simply re-run without any constraints around your SQL query to clear out all of the application. For example: psql -U krypted -d device_management -c “delete from public.ios_applications” This works for most of the tables within Profile Manager. This allows you to clear out any information stored in its own table, such as printers, tasks, sessions, widgets, etc. Note: you’re not going to remove apps from devices just because you cleared them from the table.
krypted January 29th, 2012