No announcement yet.

Powershell Process 5 Csvs Simultaneously

  • Filter
  • Time
  • Show
Clear All
new posts

  • Powershell Process 5 Csvs Simultaneously


    I'm looking to run a command/check against every machine in our domain

    I can export all the relevant PC's to a 5000 row csv file and then use a loop to run a command against them one at a time

    This does work. However cycling through the PCs one at a time will take days.

    Id really like to process all the PCs in a few hours

    Best way I can think of to do that is to split the main csv into 5 smaller 1000 row csv files and then process all 5 simultaneously

    This way I could get the answer much quicker. Ideally id like to avoid running 5 scripts each processing 1 csv. Id prefer to have just one script running.

    Is it possible to do this ?

    Thanks for reading

  • #2
    Im thinking I would need 5 e.g. foreach($item in $CsvSection1of5) loops but all run at the same time


    • #3
      Have a read at this link, foudn thru : ''; it should set you up with an answer that will work for you. It describes how to get PS to run multiple tasks simultaneously, just what you're after.
      MSCA (2003/XP), Security+, CCNA

      ** Remember: credit where credit is due, and reputation points as appropriate **


      • #4
        Ah Parallel processing was the keyword I was looking for.

        I'll have a read and test and post my summary