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.

Generating large Dynamic Collection XML externally for import - need a big collection of logged-on specific users

I want a dynamic collection of all the machines that have the logged-on users from a list of particular users. I could create the collection manually, adding each logged-on user line by line, but there are going to be 1500+ eventually.

Is there a way to have a large DC XML generated somehow from a list of these users that I can then import? A tool to generate each of the <ValueFilter> sections in bulk, with consistent table, column, comparison values but variable value values?

 

1

Comments

3 comments
Date Votes
  • David,

    If it were me, I would try using a regular expression for this.

    Admittedly, I have not ever created a PDQ Inventory dynamic collection value filter with 1500+ different values, so I have no clue how well this will perform.

    If you have a list of users in a text file with every username on a new line, you could open that list in notepad++ and use the find & replace function in "Extended" search mode, "Find what" set to \r\n and "Replace with" set to |

    Then click Replace All and you will get all of them on one line with a pipe between each one. You can then copy that and paste it into a PDQ Inventory collection like this:

    Again, you will have to test and see if this works for you. With 1500+ users it could be extremely slow or even crash PDQ.

    1
  • yes! this works for me.

     

    holding steady 600-odd users so far. thanks

    1
  • (Get-Content .\Users.txt) -join '|' | Set-Clipboard
    1