Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3802514
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:13:14+00:00 2026-05-19T14:13:14+00:00

I am trying to execute a cmdlet (test-connection) against multiple machines in parallel using

  • 0

I am trying to execute a cmdlet (test-connection) against multiple machines in parallel using the background jobs mechanism. The function below is fine until I pass more than 649 hostnames (at least on this machine) before an exception is thrown:

PS > .\test.ps1 .\650_hostnames.txt

Receive-Job : Quota violation
At H:\Development\Powershell\test.ps1:13 char:13
+ Receive-Job <<<< |
+ CategoryInfo " InvalidResult: (:) [Receive-Job], ManagementException
+ FullyQualifiedErrorId : JobStateFailed,Microsoft.PowerShell.Commands.ReceiveJobCommand

I would like to still execute the cmdlet as a background job for performance reasons, but control the number of jobs kicked off at a given time. I cannot control the input so I could get a list of many thousands to a few hundred. Any suggestions are appreciated!

test.ps1

$wkslist = $args[0]

function IsAlive {
  param(
      [Parameter(
      Mandatory = $true,
      Position = 0)]
      $computername
  )
  test-connection -count 1 -ComputerName $computername -TimeToLive 30 `
  -ThrottleLimit 10 -asJob |
  Wait-Job |
  Receive-Job |
  Where-Object { $_.StatusCode -eq 0 } |
  Select-Object -ExpandProperty Address
}

$ips = [System.IO.File]::ReadAllLines("$wkslist")
IsAlive -computername $ips
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:13:15+00:00Added an answer on May 19, 2026 at 2:13 pm

    Looks like this has nothing to do with the fact that you’re using jobs; it seems to be with the size of the input being passed to test-connection. I can reproduce the quota violation with this code:

    $ra = @(0..1000) | %{ $env:computername };
    test-connection -computername $ra;
    

    Seems to be something internal to test-connection, which ends up creating Win32_Ping WMI objects methinks. I can also get the code to work by slicing out part of the input array:

    $ra = @(0..1000) | %{ $env:computername };
    test-connection -computername $ra[0..500];
    

    Note that 650 does not appear to be a magic number – I can query up to about 800 hostnames without encountering the error.

    Since the exception is a Management exception and not a PowerShell internal exception, I’d say you’ve found one of the many magical limits of WMI. Also sounds like something that test-connection should manage internally, but doesn’t. I’ve logged an issue on Connect here, if you want to upvote it: test-connection throws quota exception when passed large list of computernames

    I would try your job code as-is, but slice the list of hostnames into smaller segments:

    $i = 100;
    $j = 0;
    while( $i -le $ra.length )
    { 
       test-connection -computername $ra[$j..$i] ... ;
       $j = $i + 1;
       $i += 100;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to execute shell command in background using pythons commands module >>>import commands >>>output
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but
Trying to execute powershell script in my C# code. Using .NET Framework v. 4.0.30319
I am trying to execute a query using for loop. For each loop it
Am trying to execute ssis package using dtexec utility from c# app(Creating New Process,
Trying to execute this: function getReport(name) { $.ajax({ type: POST, url: reportAjax.php, data: name=+
While trying to execute the below query Declare @t table (id int, string varchar(1000))
When i am trying to execute select query not executing . after the below
I'm trying to execute an EXE file using a PowerShell script. If I use
I'm trying to execute a sql script using the task in SSIS. My script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.