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

  • Home
  • SEARCH
  • 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 8280369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:39:10+00:00 2026-06-08T09:39:10+00:00

Here’s a script I’m trying to run, where $servers = @(computer1,computer2) $servers | %

  • 0

Here’s a script I’m trying to run, where $servers = @(“computer1″,”computer2”)

$servers | % {
    Start-Job -ScriptBlock {param($c) Get-EventLog -LogName "Application" -Newest 10 -ComputerName $c} -ArgumentList $_
}

The issue I’m having is that the jobs will stay “running”. I thought perhaps this was an issue with passing parameters, so I removed that portion of the script, like so-

$servers | % {
    Start-Job -ScriptBlock {param($c) Get-EventLog -LogName "Application" -Newest 10} -ArgumentList $_
}

… and it worked. I then tried to specify the computername (to validate it was a parameter passing issue), like so –

$servers | % {
    Start-Job -ScriptBlock {param($c) Get-EventLog -LogName "Application" -Newest 10 -ComputerName "computer1"} -ArgumentList $_
}

The expected effect would be for it to get remote events on the same server twice. Instead I experienced the same issue as before: the script starts 2 jobs which both stay in a running state for… ever.

Any ideas or pointers?

Quick Edit:

I did also try to just use Get-EventLog on the remote machine without trying to run it in a job. That works fine.

Final Edit:

From Keith’s response it looks like the issue is in my environment. I’ll troubleshoot further on my own and accept Keith’s answer as it pointed me to that conclusion.

  • 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-06-08T09:39:12+00:00Added an answer on June 8, 2026 at 9:39 am

    For what it’s worth, I can’t repro this error on either PowerShell V2 or V3:

    8# 'build3','build5' | %{ Start-Job -ScriptBlock {param($c) Get-EventLog -LogName "Application" -Newest 10 -Comput
    erName $c} -ArgumentList $_}
    
    Id              Name            State      HasMoreData     Location             Command
    --              ----            -----      -----------     --------             -------
    5               Job5            Running    True            localhost            param($c)...
    7               Job7            Running    True            localhost            param($c)...
    
    
    9# Get-Job
    
    Id              Name            State      HasMoreData     Location             Command
    --              ----            -----      -----------     --------             -------
    1               Job1            Failed     False           localhost            param($c)...
    3               Job3            Completed  False           localhost            param($c)...
    5               Job5            Completed  True            localhost            param($c)...
    7               Job7            Completed  True            localhost            param($c)...
    
    
    10# Receive-Job -id 5
    
       Index Time          EntryType   Source                 InstanceID Message
       ----- ----          ---------   ------                 ---------- -------
     1397893 Jul 20 15:47  Warning     Group Policy Inte...   2248216579 The description for Event ID '-2046750717' in S...
     1397892 Jul 20 15:47  Warning     Group Policy Regi...   2248216579 The description for Event ID '-2046750717' in S...
    

    It could be configuration issue. Do you have the Remote Registry service running on the servers? Also, you can run Receive-Job on the jobs even while they’re running to get intermediate output & errors. Perhaps some error info would help track down the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenerio of what is happening in the script: Session is start. $id
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is my SQL script CREATE TABLE tracks( track_id int NOT NULL AUTO_INCREMENT, account_id
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here is the problem that I am trying to solve. I have two folders

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.