Important Notice: On February 29th, this community will be put into read-only mode. All existing posts will remain but customers will be unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Dynamic collection to compare two values

Goal: Compare two files (one local to the client computer, one on a fileshare), and store in the collection if the local file is older than the one on the fileshare.

This is for a vendor application that does not use version numbers etc, and the installer file is updated by a 3rd-party. I do not want to rely on the 3rd-party informing we when they have updated the installer.

The ultimate goal is for a set-and-forget setup where every time the file on the fileshare (the installer) is updated, PDQ will go out and update clients as they enter the dynamic collection.

Is there a way to achieve this in PDQ Inventory?

I understand there is a manual method of setting environment variables yourself when the program is updated, but I am going for a set-and-forget setup here.



Date Votes
    1. Back up your PDQ Inventory database.
    2. Create a Custom Variable in PDQ Inventory. In my example I created "File_Timestamp".
    3. Create a PowerShell script to query the file on the fileshare and update "File_Timestamp". Create a Scheduled Task or a PDQ Deploy package and schedule to run this at your desired interval.
      $File_Modified_Time = ( Get-ItemProperty \\Path\To\File ).LastWriteTime
      $PDQ_Update_Time = Get-Date -Format "yyyy-MM-dd HH:mm:ss"

      sqlite3 "C:\ProgramData\Admin Arsenal\PDQ Inventory\Database.db" "UPDATE CustomVariables SET Value = $($File_Modified_Time) WHERE Name = 'File_Timestamp';"
      sqlite3 "C:\ProgramData\Admin Arsenal\PDQ Inventory\Database.db" "UPDATE CustomVariables SET Modified = $($PDQ_Update_Time) WHERE Name = 'File_Timestamp';"
    4. Create a Dynamic Collection that compares Date Modified to "File_Timestamp".

  • This is a workable workaround, thanks. I am making sure to leave a delay between running this package and my application package, as the dynamic collection isn't picking up the change instantly.


Please sign in to leave a comment.

Didn't find what you were looking for?

New post