[PowerShell] Ping multiple servers simultaneously with PowerShell: Test-ConnectionAsync (strange problems)

I am hoping the author of the script "Ping multiple servers simultaneously with PowerShell: Test-ConnectionAsync" can help me.
I found it at: https://gallery.technet.microsoft.com/scriptcenter/Multithreaded-PowerShell-0bc3f59b
I am using the version dated: 5/8/2014
I extraced the entire function from the .psm1 file for use in a script that continuously pings about 100 devices and sends an email when a device has failed three times in a row.  At some point, usually between 15 minutes and several hours, the script
stops running.  If I break out of it <CTRL>-C, and run a "Get-Job" command, I can see that a job is "stuck" at the "Running" state.  I can even retrieve the data using "Receive-Job" and it looks fine.
 Here is a sample of the Get-Job after the program froze (I changed the Source and Destination to protect the names/IPs)...
PS C:\Program Files\ServerScripts\DeviceMonitor> Get-Job
Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
145678 Job145678       WmiJob          Running       True            .                    Test-Connection
PS C:\Program Files\ServerScripts\DeviceMonitor> Receive-Job 145678
Source        Destination     IPV4Address      IPV6Address                              Bytes    Time(ms)
SERVER1  XX.XXX.XXX.XX   XX.XXX.XXX.XX                                             32       5
SERVER1  XX.XXX.XXX.XX   XX.XXX.XXX.XX                                             32       5
SERVER1  XX.XXX.XXX.XX   XX.XXX.XXX.XX                                             32       5
SERVER1  XX.XXX.XXX.XX   XX.XXX.XXX.XX                                             32       5
PS C:\Program Files\ServerScripts\DeviceMonitor> Get-Job
Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
145678 Job145678       WmiJob          Running       False           .                    Test-Connection
I tried added some additional output in the function to troubleshoot but I can't seem to find the root cause.  I would be happy if I could remove the "stuck" job after a certain amount time, even though this doesn't get to the root of the
problem.
Any assistance would be appreciated.  Even if you could point me in the right direction.
Thank you.

Hi,
Questions for Gallery items should be asked on the QandA tab of the listing, as that is usually the fastest way to contact the script's author:
https://gallery.technet.microsoft.com/scriptcenter/Multithreaded-PowerShell-0bc3f59b/view/Discussions#content
Dave does frequent this forum, so you might get a response from him here directly.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • How to clean the html code multiple pages simultaneously with Dreamweaver or other soft ?

    hello,
    How to clean the html code multiple pages simultaneously with Dreamweaver or other soft ? I have hundreds of pages to clean
    Thanks !

    I would start afresh. I would also use Dreamweaver's template system to make thing a lot easier. Have a look at the following, copy and paste into a new document and view in your favourite browser.
    <!doctype html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" />
    <script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
    <script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <style>
    .hline {
        background: url(http://yannick.michelat.free.fr/barre.gif);
        height: 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    </style>
    </head>
    <body>
    <div class="container">
        <div class="row">
            <div class="col-xs-7">
                <img alt="" class="img-responsive pull-right" style="margin-top:20px;" src="http://yannick.michelat.free.fr/Calanques.gif" />
            </div>
            <div class="col-xs-5">
                <img alt="" class="img-responsive center-block" style="margin-top: 40px;" src="http://yannick.michelat.free.fr/grandportfolio.gif" />
            </div>
        </div>
        <div class="row hline"></div>
        <div class="row">
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-01.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-02.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-03.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-04.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-05.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-06.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-07.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-08.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-09.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-10.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-11.jpg" alt="" class="img-responsive"></a></div>
            <div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-12.jpg" alt="" class="img-responsive"></a></div>
        </div>
        <div class="row hline"></div>
    </div>
    </body>
    </html>

  • How to add ProxyAddress attribute to multiple users? with powershell

    I need to add the attribute ProxyAddress several users at once, in AD 2008 R2. with powershell.
    Thanks beforehand.

    Hi,
    Use Set-ADUser:
    http://ss64.com/ps/set-aduser.html
    See the -Add parameter.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Multiple image upload with save to database wizard problem

    hi,
    i need to upload multiple images (6) in a table called pictures. i will need the names stored in the database and the files uploaded on the server. since i am new to dreamweaver i can not figure out on how to make this work.
    the multiple image upload wizard uploads the images fine and creates a subfolder with the right id but i have no file names in the database at this point. i tried the multiple image upload with save to database wizard but i only get one upload button. it worked fine with one image but i need 6 pics uploaded. the i tried to first upload the pictures with the multiple image upload wizard and use the update wizard to add the names afterwards but that did not work either. hmm. would be great if someone could help me out.
    thanks, jan

    Thank you for the responses. I have already updated awhile ago, so I am wondering what happened. Not sure if during the server update, some files were replaced (unless I totally forgot to update to 1.0.1 on this site). So I reinstalled 1.0.1, deleted the includes folder from the server and uploaded my includes folder and it now works again.
    Again, thanks for the help.
    Jeremy

  • Submitting a form with enter key causing strange problems

    I am having a very strange problem with a webapp I am currently developing. I am using JSF 1.2 along with Facelets and RichFaces. I have coded a workflow/wizard 4-step process, and on some pages I have 4 submit buttons that all call different actions on the page. The users thought it would be useful to have the enter key submit the form, so I followed some online resources to trap a keypress using javascript, looking for the enter keycode and calling document.getElementById("elementName").click(). This works fine most of the time. Sometimes, though, it seems as if an entire new session is being created, and odd behavior starts happening. For example, my page will only include 2 of the 4 facelets on the screen -or- I will get NullPointerExceptions for objects that I know have been created in the session bean I am currently using -or- I will get a duplicate form Id after trying to re-submit the page. Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"? I'm really at my wit's end here (plus it's nearly 3 AM, that never helps things). All of the buttons being clicked are standard h:commandButtons. There is some setTimeout logic included to disable the buttons on the page to prevent double clicks (I cannot disable them onsubmit because disabled buttons don't pass the right values, perhaps that's causing it, but if so, clicking the buttons with the mouse would cause that issue too, right?)
    I am not posting the code (yet), but if anyone wants to take a look see and see if I am doing something really abhorrently wrong, I'm more than willing to, I'm just curious if anyone has had problems regarding javascript submission of forms via the click() method. Clicking the button does not exhibit this type of behavior. Just as a side note: I am doing different things with the enter key depending if a modal window is open (the enter key closes the modal if it's up, and if not, it submits the form via a button click).
    Any help is much appreciated, if anyone has any inkling about where I should start looking for answers it would be really helpful.
    Thank you.

    edfrost wrote:
    Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"?My guess is the second of these. You need to suppress the event handling after programmatically clicking the button.

  • Please help me with Nokia E71 very strange problem...

    I have Nokia E71_v1, I got lots of strange problem like:
    1- The camera didnt save the images and create the images like this: Name of the image*jpg but I can take videos without a problem.
    2- when I put anything in the memory card or the phone memory it became currpted and then I couldnt open them at all, the message "can open the file" or "file is currpted" appears.
    3- I couldnt install any application to the phone, if I put any sis file on the memory I get "file currpted" message but if I sent it to the phone via bluetooth I could install it.
    4- The name of the folders usually change their name and currpted characters appeard in the folder naming.
    5- When I added any mp3 files to any memory the files are disappeared.
    410.21.010
    RM364
    Noka E71-1 (19)
    please help
    Attachments:
    090620091272.jpg ‏242 KB
    090620091273.jpg ‏299 KB

    You better reset the E71. Dial *#7370# 12345 reformat, you'll lose all data. Make a backup first and restore without the settings. Reformat the card in the phone and remove the card using the menu from the power button. Do not encrypt the card as a test.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • [SOLVED]Multiple servers/services with only one machine

    Hello,
    First of all, thank you for taking time to read this post.
    Long story short: I had a machine laying around so i decided i would use it as a router/wireless access point since my isp router isn't working so well, but since the machine is not working anymore, and i don't have the resources(a.k.a. money) to fix it, i decided to use my main machine instead and make my laptop my main machine.
    I have been reading the arch wiki regarding how to make a router and a wireless access point, but then i remembered something, what if i decide i need another server(http/https, ftp, NAS, IRC) which i might want, could i use virtualbox?
    So my question is: can i have my computer with arch serving as a router + wireless access point and on the same machine, virtual machines with arch running other services? If i kept the files from this servers, like the www folder, of ftp folder, on the host machine would this be a security risk? This not intended for a enterprise environment, only here at home.
    Thank you.
    Last edited by jantonio2992 (2013-12-03 17:12:24)

    ewaller wrote:
    jantonio2992 wrote:Ok, so i can run everything in this machine. Can i still use this machine as a main machine (using virtual machines to test apps and its configs)? Or that might make me break the system?
    That would depend on the traffic   If it is just for you or your LAN, probably not a problem (unless you are streaming video to a bunch of machines).  <Sarcasm>OTOH, unlike others, you might want try to run an entire national health care sign-up site on it * </Sarcasm>
    * Note ... I have no concept as to the real architecture of the Affordable Health Care Act web site.
    Edit:  Too slow.
    Sorry i didn't see you answer befores i posted my last. It would be only for my Lan, only serve i would run to the Internet would be SSH.. And no streaming video

  • Connect via Windows Powershell in SCCM 2012 CONSOLE (with PowerShell 4.0 installed)

    Hi,
    When trying to "Connect via Windows Powershell" in the SCCM 2012 console, I get the message that Powershell 3.0 is not installed... (which actually isn't installed, we have PS4.0 installed). Do we need to install PS3.0 also to get it working
    or is there a workaround? Connecting manually to the site via Powershell 4.0 (Get-Psdrive -psprovider CMSITE) works like a charm.
    Regards,
    WiM

    Hi,
    I have installed WMF 4.0 on Windows Server 2008 R2 sp1, it works fine.
    Please try to use "$PSVersionTable" to confirm Powershell version is 4.0. At first, I forgot to install Microsoft .NET Framework 4.5, then the console gave me the message that Powershell 3.0 is not installed.
    Best Regards,
    Joyce Li
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Run two X servers simultaneously with remote access.

    I have a htpc running a xbmc frontend. I would like to have it run a second X environment that I can access via vnc (or VNC like protocol) only. Does anyone have any recommendations or a better solution?
    I would like to have whatever application I am running remotely to continue running if I lose my connection. Would this be possible with screen and ssh X11 forwarding?
    Last edited by wasutton3 (2012-11-02 18:11:59)

    I have the same environment here, an htpc with XBMC. Have a look at xpra (xpra-winswitch-svn in the AUR). It allows you to forward single X windows that integrate more or less in your remote environment. I wrote few scripts to start different sets of applications remotely via ssh. It is often faster than forwarding an entire desktop and you can even have one X $DISPLAY per set of applications. It is by far the most elegant solution I have used.
    If you really need an entire desktop, I'd recommend NX instead of VNC.

  • ? play multiple videos simultanously with a single control bar ?

    I have 4 live f4vs that I'm using with interactive server 3.5.  Thus they are running in dvr.  I'm trying to find a way to control all 4 videos so that when you go back on one video all 4 videos go back to the same time.  This is very important with camera 4 as it is the only one with sound.
    I have tried putting all 4 videos in one swf file and I have tried putting each video as its own swf.  So far I can't figure out how to do it, any help would be greatly appreciated.
    Thanks
    stjc3
    I know something similar was listed previously at
    http://forums.adobe.com/message/64579
    But the link to the solution is bad
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1292827&enterthread=y

    Thanks for the quick responce.
    The streams are very close to being in sync but they tend to be about half a second to a couple of seconds out of sync.  I tried using the timecode in fmle but when I do that it seems to mess up the dvr feature and kill 2 or more streams so that you can only watch old data and not new.
    So... Will it still work if they are mostly insync?  If so how do I customize the seekbar?
    Also are there any extra steps I need to take since The size of the file will continue to increase while the player is in use?
    Thanks again
    stjc3

  • Testing SWF with external XML file, strange problem.

    Hi!
    My problem started after migration to 2.01. But I think it's
    not version problem.
    I have old project which uses external XML files ("
    http://www.mydomain.com/myxml.xml").
    When I teste project in "bin" folder it works perfect and SWF
    import data from XML.
    I created new Flex project and copied all scripts from old
    one. And my new app can't read external XML!!! (tested in "bin"
    folder):
    *** Security Sandbox Violation ***
    Connection to xmlURL halted - not permitted from
    file:///C:/myproject/bin/myproject-debug.swf
    BUT when I copy my new SWF to the old project "bin" folder
    then it WORKS! Strange!
    I found in Help "The Global Flash Player Trust directory" and
    I checked files: "flexbuilder.cfg", "flexbuilder.fbr" there are all
    my project paths (old and new).
    Thanks for help!
    newman

    You should your homework with Google and other search engines
    better ;)
    http://www.robrusher.com/1/2006/08/Flex-2-Error-with-XML.cfm

  • Not able to access Mozilla with the generic account (NIS account) by multiple users simultaneously

    • Using a single Generic account multiple users are trying to login from different machines simultaneously to Mozilla Firefox. • The Mozilla Firefox is fully operational only for the first user who has initially opened Firefox session. • If the second user trying to access the Firefox with the same account, it is displayed as there is another session is already running and most of the Firefox options are getting grayed out i.e the navigation, history and forward/ backward tabs available in the menus become inaccessible.Our Requirement is that multiple users need to access multiple sessions simultaneously with all the features of Firefox available. Kindly assist me here.

    Same problem, Pls help me

  • ODI 11g 11.1.1.7 with Win64 bit OS : Starange problem : Right click does not work for Create new data server in Topology.

    ODI 11g 11.1.1.7 with Win64 bit OS : Strange problem : Right click does not work for Create new data server in Topology.
    On right click nothing happens at all. I have  reinstall the ODI multiple times with right installer. issue persist.
    Please help.

    Hi,
    Did you use the generic installer or the win32 one ? You should use the former with Win64.
    You can also check that your version of Java is supported in the certification matrix.
    Regards,
    JeromeFr

  • SCOM 2012 Get Gray Management Servers With PowerShell

    Hi,
    I have SCOM 2012 R2.
    I want to get all the Management Servers that are in Gray state using powershell. How can I do that?
    I couldn't find anything good in the internet.
    The best I got was Get-SCOMManagementServer but when I tested it out - it still showed that my gateway's HealthState was "Success" even though it was gray.
    Thanks,
    Yakir.

    Hi,
    Check if this one helps
    Get-SCOMClass-name"Microsoft.SystemCenter.ManagementServer"|get-scomclassinstance|selectdisplayname,healthstate
    I dont what is your final objective, but check this link
    http://blogs.technet.com/b/jasonrydstrand/archive/2013/03/27/daily-scom-health-check-with-powershell.aspx

  • Unable to create web app with PowerShell - An update conflict has occurred

    I am trying to create a new Web Application using PowerShell. I need to use PowerShell because I need to create the Web App using classic authentication and not Claims authentication. the first time I created the Web App, everything went great. Ever since
    the first time, I get an error and the web app creation does not complete. Just as an FYI, I can create a new Web App using Central Admin, but that creates it with Claims authentication which I cannot use.
    Here is my PowerShell script
    New-SPWebApplication -Name "SharePoint2013 (82)" -ApplicationPool "SharePoint2013-82" -AuthenticationMethod "NTLM" -ApplicationPoolAccount (Get-SPManagedAccount "GLOBAL\SP_AppPool") -Port 82 -URL "http://sharepoint2013"
    Here is the error I get in PowerShell
    New-SPWebApplication : An update conflict has occurred, and you must re-try this action. The object SPWebApplication
    Name=SharePoint2013 (82) was updated by DOMAIN\SP_Administrator, in the powershell (13020) process, on machine SPWEB01.
     View the tracing log for more information about the conflict.
    At line:1 char:1
    + New-SPWebApplication -Name "SharePoint2013 (82)" -ApplicationPool "SharePoint201 ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Microsoft.Share...PWebApplication:SPCmdletNewSPWebApplication) [New-SPWebA
       pplication], SPUpdatedConcurrencyException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPWebApplicationUnknown SQL Exception 547 occurred. Additional error information from SQL Server is included below.
    The DELETE statement conflicted with the REFERENCE constraint "FK_Dependencies1_Objects". The conflict occurred in database "SP_Config", table "dbo.Dependencies", column 'ObjectId'.
    The statement has been terminated.
    I also get  this error from the trace
    Unknown SQL Exception 547 occurred. Additional error information from SQL Server is included below.
    The DELETE statement conflicted with the REFERENCE constraint "FK_Dependencies1_Objects". The conflict occurred in database "SP_Config", table "dbo.Dependencies", column 'ObjectId'.
    The statement has been terminated.
    I have tried to resolve the issue by performing the following:
    Delete the partially created web app using Central Admin or PowerShell
    Clear the file system cache on all servers in the farm (Stopping wss timer job, Saving Copy of the
    cache.ini file from C:\Documents and Settings\All Users\application data\Microsoft\SharePoint\Config folder. Clearing all the .xml files from the location except cache.ini but Edit the cache.ini to have value 1. Starting the timer job)
    Use Products Configuration Wizard (no detach, just 'upgrade') - People have said to select the option to disconnect the server from server farm and revert back again at next step (so you actually do not disconnect), but there is no next step that I have
    encountered. You select 'disconnect', hit next, and the server disconnects.
    Restart all the servers in the farm
    Run the PowerShell script again...still get the same error
    I have tried it on multiple servers in the farm too.

    Hi Michael,
    I found a similar thread for you reference:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/9ccef7bf-87a9-4849-b086-4db2d898f1d7/cannot-create-new-web-application-wss-30?forum=sharepointadminlegacy 
    If it doesn’t work, sometimes the issue might be caused by long time keep powershell opening and generating some cache files. So please try re-opening the powershell and test the issue again.
    http://blogs.msdn.com/b/ronalg/archive/2011/06/24/mount-spcontentdatabase-errors-on-2nd-and-subsequent-attempts-of-same-database.aspx?Redirected=true 
    http://www.oakwoodinsights.com/sharepoint-powershell-surprise/
    In addition, here is an article which explains the possible reason of the SQL error:
    http://technet.microsoft.com/en-us/library/ee513056(v=office.14).aspx
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

Maybe you are looking for

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone, I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query

  • Restore can't find the time machine backup

    I am trying to restore my system from a time machine backup and the Restore option doesn't recognize my time machine backup. Any ideas on how to force it to see it? Some background: I am running Mountain Lion on a 2008 iMac. About 1 week ago, my inte

  • Need a new hard drive for dv6-1230us

    My issue is regarding the HP Pavilion Entertainment PC dv6-1230us. Recently, it was dropped and since then it has been giving me the following message whenever it boots up. Boot Device Not Found Please install an operating system on your hard disk. H

  • Install Oracle 8.1.7 on Tru64 UNIX 4.0F

    hello: I have installed oracle8.1.7 on Tru64 UNIX 4.0F. After startup database and start listener,at first only one listener service could be found using command lsnrctl status looks like: Service "ORA8" has 1 instance(s). The command completed succe

  • Where to find the downloadpack, I have purchased the licensekey

    Where to find the downloadpage for Lion