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

Computers that match a list of models

I have a piece of software that only supports specific models, and I want to create a dynamic group of those computers.

The list of model strings is really long (500+), and so I don't want to have to create a filter rule for every single one, e.g.:

Is there a way I could put the list of model strings in a file and or variable and have one filter rule instead?

1

Comments

2 comments
Date Votes
  • Matthew,

    I would do this with a regex filter. Example dynamic collection filters using some models from my environment:

    Any
    Computer > Model > Matches Expression > ^(Alienware Area-51 R5|HP ENVY Pro 4-b000 Ultrabook PC|HP ProBook 6470b|HP ProDesk 400 G1 SFF)$

    If you can get all of the correct models into a text document with each one on a new line (such as a CSV formatted PDQ report) then you can easily generate this regex by following these instructions:

    • Open the text file in Notepad++
    • Press ctrl+f to open the find & replace dialog box
    • Click the "Replace" tab
    • Change the "Search Mode" to "Extended"
    • Find what: \r\n
    • Replace with: |
    • Replace All
    • Plug your new regex expression into my example collection above

    I have never run this with as many as 500 different search terms in the regex expression so I cannot guarantee this will work but this is my best guess on a solution.

    2
  • Thanks Luke. I'm not sure how it'll perform running a regex query of that size, but it can't hurt to try. I'll see if it works.

    1