Is it possible to load balance a powershell script?

I currently have a script which scans an entity for various things, as well as a separate script which creates 20 Jobs at a time executing that script to scan a specified entity. I need to scan over a thousand of these entities and each passthrough through the entire environment takes over 6 hours.

I have a bunch of windows servers which I want to use to be able to distribute the workload across all these servers, and reduce the time it takes to do a passthrough across the entire environment.

What I’m looking for is a way to load balance powershell scripts. I’ve looked into Windows Network Load Balancing, but I haven’t seen any thing where people have used it to load balance powershell scripts, I’ve seen it for internet applications, but I’m not sure if this will work for Powershell scripts.

NLB won’t work for you in this case.

My understanding is that you have a script that creates jobs in lots of 20. You need a 1000 of these jobs to run across your environment. You’ll be running these scripts across a number of servers.

My recommendation would be to investigate using PowerShell runspaces to provide your parallelisation unless you want to invest in an orchestration engine that could do more of the work for you