0

It looks like this code is executing in parallel. There are many machines in the domain. I would like to finetune how many requests do in the same time for a sake of speed. How can set a throttle limit?

$comps = Get-ADComputer * -Properties description
$comps `
    | Select Name,
        @{name="User"; e={
            (Get-WMIObject -Class Win32_ComputerSystem -Computer $_.name).Username}},
        @{name="Description"; e={
            ($_.description)}} `
    | Out-GridView
user2978216
  • 474
  • 2
  • 6
  • 19
  • [`$comps | Foreach-Object -Parallel -TrottleLimit { ...`](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object)? – iRon Feb 10 '23 at 07:43
  • @iRon We've got Windows 10 with Powershell 5.1. Such command doesn't exist I think. – user2978216 Feb 10 '23 at 07:49
  • Probably the easiest (and fastest) solution is [installing a newer version of PowerShell](https://github.com/PowerShell/PowerShell) which runs aside the existing Windows PowerShell. – iRon Feb 10 '23 at 08:10
  • 1
    See also the solution from **[@Santiago Squarzon](https://stackoverflow.com/users/15339544/santiago-squarzon)** in this answer: https://stackoverflow.com/q/74257556/1701026 – iRon Feb 10 '23 at 08:25

0 Answers0