HP Device Manager 4.4 to 4.7 Password Recovery

This process works for at least version 4.4 to 4.7, it may work for other versions as well. It only works for HPDM backed by PostgreSQL. The same concepts could be applied to MSSQL, but I don't have directions for that. Do the following steps on the HPDM Server where the database is located. The password for the user account will be "password" when you are done. This is unsupported, proceed at your own risk!
Take a backup (or two) before proceeding!
  1. Stop the HPDM Server and HPDM PostgreSQL services.
  2. Open "C:\Program Files (x86)\HP\HP Device Manager\Server\pgsql\data\pg_hba.conf" in Notepad or similar.
  3. At the bottom of the file are two lines like this: host all all md5 host all all ::1/128 md5 Change the "md5" on the end to "trust". Save (you may have to edit the file's permissions to be able to save).
  4. Start the HPDM PostgreSQL service. It will fail, this is correct.
  5. From a command prompt navigate to "C:\Program Files (x86)\HP\HP Device Manager\Server\pgsql\bin", run the following command: psql -h localhost --username=postgres -p 40006 -d hpdmdb
  6. At the hpdmdb=# prompt, find the username of your administrator account(s) by running: select user_id from dm_group_user where group_name = 'Administrators';
  7. "Reset" the password for a user to "password" by running: update dm_user set password='BF46D06915FB4352C6D087AA3378C380' where user_id='the username from #6';
  8. Enter "\q" (without the quotes) to exit the psql prompt.
  9. At the command prompt still, run the following: "C:/Program Files (x86)/HP/HP Device Manager/Server/pgsql/bin/pg_ctl.exe" stop -m fast -D "C:/Program Files (x86)/HP/HP Device Manager/Server/pgsql/data"
  10. Open the file from #3 again if you closed it. Undo the changes you made, returning "trust" to "md5".
  11. Start the HPDM PostgreSQL and HPDM Server services again.
Shoutout to whomever designed the database schema, good design. Something you don't see everyday.