Help Center

Follow

Save & Restore Remote Command History to/from File in PDQ Inventory

Purpose:

You wish to save or restore the command history used in the Inventory Menu > Tools > Remote Command (or Ctrl+Alt+C). This is useful to ensure you have a copy of the command history in case of accidental deletion. This is also useful if you wish to copy the command history from one console to another or to create a custom Remote Command list and import that into PDQ Inventory.

Note: the command history is not machine dependent, meaning that the command history is all commands issued remotely regardless of which machine(s) the commands were run against. This makes running remote commands across multiple machines much easier than copy/paste or manual entry methods.

Resolution:

Warning | Precaución | Auchtung | Mise en garde | Attenzione

Directly modifying the SQLite database should be performed only as needed. Modifying the SQLite database in an incorrect manner may result in unintended consequences up to and including irrecoverable data loss; a corrupt database requiring the complete uninstall and reinstall of the program; and existential dread associated with being alone in an uncaring, meaningless and indifferent universe. It is strongly recommended you stop the PDQ Inventory service and make a backup of the the .db* files located in %programdata%\Admin Arsenal\PDQ Inventory before accessing the SQLite console.

Save Remote Command History:

To save the Remote Command history to a .csv file, perform the following:

1. In PDQ Inventory, go to File > Preferences > Database and click on the SQLite Console button.

2. The SQLite console will open in a new window. You will want to type the following, hitting the enter key at the end of each line.

.mode csv
.output name_of_output_file.csv
select command from RemoteCommandHistory;
.output stdout

3. The CSV file is located in %programfiles(x86)%\Admin Arsenal\PDQ Inventory\

Restore Remote Command History:

If you should accidentally delete your command history or wish to import it to another console, or to restore (or append) the Remote Command history from a .csv file, perform the following:

1. In PDQ Inventory, go to File > Preferences > Database and click on the SQLite Console button.

2. The SQLite console will open in a new window. You will want to type the following, hitting the enter key at the end of each line. Note: the CSV file from which you wish to restore from must be located in %programfiles(x86)%\Admin Arsenal\PDQ Inventory\

.mode csv
create table TempHistory (command);
.import name_of_file.csv TempHistory
insert into RemoteCommandHistory (Command) select command from TempHistory ;
drop table TempHistory;

NOTE: Should you decide to clear your history for whatever reason, you can do that within the Remote Command window:

Or through the SQLite console:

Special thanks to Shane and Chase for providing their SQL skills to this article.

See Also:

Running a Remote Command: GPUpdate

Running Remote Commands on Multiple Computers

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk