Powershell Test-connection Cmdlet

Hi all,
i want to test the connectivity between two specfic NIC ports. i executed the command :
Test-Connection -ComputerName "10.15.0.1" -Source "10.15.250.53" -Quiet. but it has banged an error message:
parameters set cannot be resolved using the specified named parameters.
FYI- i executed the command without "-Quiet" and successfully executed.
all i want to test the connectivity between the two specific NIC ports and i should get a boolean value. Please help me in this matter.
Thanks,
Hemanth

You can't use -Quiet when also using -Source.  From the help (below), we can see that the -Source argument appears in the second parameter set, while the -Quiet doesn't.  The opposite applies to the third parameter set.
SYNTAX
Test-Connection [-ComputerName] <string[]> [-AsJob] [-Authentication <AuthenticationLevel> {Default | None | Connect | Call | Packet |
PacketIntegrity | PacketPrivacy | Unchanged}] [-BufferSize <int>] [-Count <int>] [-Impersonation <ImpersonationLevel> {Default | Anonymous |
Identify | Impersonate | Delegate}] [-ThrottleLimit <int>] [-TimeToLive <int>] [-Delay <int>] [<CommonParameters>]
Test-Connection [-ComputerName] <string[]> [-Source] <string[]> [-AsJob] [-Authentication <AuthenticationLevel> {Default | None | Connect | Call
| Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-BufferSize <int>] [-Count <int>] [-Credential <pscredential>] [-Impersonation
<ImpersonationLevel> {Default | Anonymous | Identify | Impersonate | Delegate}] [-ThrottleLimit <int>] [-TimeToLive <int>] [-Delay <int>]
[<CommonParameters>]
Test-Connection [-ComputerName] <string[]> [-Authentication <AuthenticationLevel> {Default | None | Connect | Call | Packet | PacketIntegrity |
PacketPrivacy | Unchanged}] [-BufferSize <int>] [-Count <int>] [-Impersonation <ImpersonationLevel> {Default | Anonymous | Identify |
Impersonate | Delegate}] [-TimeToLive <int>] [-Delay <int>] [-Quiet] [<CommonParameters>]
Grant Ward, a.k.a. Bigteddy

Similar Messages

  • PowerShell Test-connection and Active Directory Input

    I am just learning powershell, and I"m working to write a script that pulls computer names from AD and puts them into a Test-connection cmdlet to determine if its valid.
    clear-host
    import-module activedirectory
    $workstations = Get-ADComputer -Filter '*' -SearchBase "OU=CMSD,OU=Windows XP,OU=Workstations,DC=TECH,DC=LOCAL" | FT Name
    Foreach($w in $workstations)
    Test-Connection -ComputerName $w -Count 1
    when i run the script, i receive the following error for all entries:
    Test-Connection : Testing connection to computer 'Microsoft.PowerShell.Commands.Internal.Format.GroupEndData' failed: The requested name is valid, but no data of the requested type was found
    At line:6 char:24
    + Test-Connection <<<< -computername $w -Count 1
    + CategoryInfo : ResourceUnavailable: (Microsoft.Power...at.GroupEndData:String) [Test-Connection], PingException
    + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand
    I'm thinking that when the array is going into the Test-connection cmdlet, its adding string characters such as "name=computer" and not just the computer name.  I don't know how to edit strings in powershell.  
    any help is appreciated, thank you.

    When you return a computer you get multiple properties - DN, Name, SID, etc. You need to indicate what property you want using dotted notation.
    Test-Connection -ComputerName $w.Name -Count 1
    You can also only return the Name when you do your Get-ADComputer by piping it to Select-Object. If you do this option, your variable would not need the dotted notation (.Name). $w is all you would need, since it would only contain the Name property.
    Get-ADComputer -Filter * -SearchBase ... | select Name
    Oh my, I just realized you are piping this to Format-Table - get rid of that! Do one of the two options above and you should have this figured out. Doing a select may be the best option since you will be returning a smaller set of information.

  • Test-Connection problem

    Running in to strange issue with the Test-Connection cmdlet, both inside a script I am writing and when running it directly from a powershell session.  No matter what computer/site I try to test I get "test-connection : Not Found"(full error
    text below) this occurs even when trying test-connection localhost. I am able to ping both localhost and remote computers without a problem.  it looks like someone had a similar problem a few years ago(http://social.technet.microsoft.com/Forums/scriptcenter/en-US/dad5613a-aa6e-4f0d-b99d-82d6afda83d7/bizzare-testconnection-failure?forum=ITCG)
    but it doesn't look like it was ever resolved and none of the suggestions in the thread worked for me. 
    Test-Connection : Not found
    At line:1 char:16
    + test-connection <<<<  127.0.0.1
        + CategoryInfo          : InvalidOperation: (:) [Test-Connection], ManagementException
        + FullyQualifiedErrorId : TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand

    Test-Connection is based on querying the Win32_PingStatus WMI class.  I suspect you might have a corrupted WMI repository.  There are instructions for rebuilding it on the knowledge base, I believe.  Should be easy to find with a web search. 
    (I'd do it, but I'm posting this from my phone.)

  • Test-connection

    I am trying to write a script that tests three IP's in sequence (test-connection). If any of the three return TRUE (respond) then the script needs to end. If all three return false (don't respond) then execute a new set of powershell commands.
    I'm pretty sure it is something somewhat simple, but I'm just not figuring it out. I've tried using IF, ELSEIF statements, but I'm not making any progress.
    Help would be greatly appreciated..
    Regards,
    David

    The code doesn't do exactly what I want, I may have explained it poorly. What I've come up with is the following...
    if(Test-Connection-Cn10.0.10.1-BufferSize16-Count1-ea0-quiet)
    #end if
    exit
    if (Test-Connection-Cn10.0.10.122-BufferSize16-Count1-ea0-quiet)
    #end if
    exit
    if (Test-Connection-Cn10.0.10.123
    BufferSize16-Count1-ea0-quiet)
    #end if
    exit
    ELSE {"All tested routers 'failed'
    to respond."}
    #end if
    exit
    Just looking at it now I think I can remove the "-Cn" part since I'm using IP address. This only produces the "All tested routers 'failed' to respond" line if all three connections fail, if any are successful it just exits. If all three
    fail then the next part is to execute PowerShell commands to trigger SRM failover, I found module to support being able to do this from PowerShell.
    Regards,
    David

  • Test-*Connectivity commands don't work

    I have a coexistence environment (2013 SP1 CU6, 2007) in two sites. I create a test user on each site. When run any of Test-*Connectivity commands like (Test-OWAConnectivity, Test-ECPConnectivity) I got the following errors:
    Test-OWAConnectivity from Passive Copy Mailbox Server (***MBX01):
    Url                         :
    UrlType                     : Unknown
    ClientAccessServerShortName : ***MBX01
    Scenario                    : Reset Credentials
    ScenarioDescription         : Reset automated credentials for the Client Access Probing Task user on Mailbox server mailbox_server.Domain.com.
    PerformanceCounterName      : Logon Latency
    Result                      : Failure
    Error                       : [Microsoft.Exchange.Monitoring.CasHealthStorageErrorException]: An error occurred while trying to access mailbox mailbox_server.Domain.com, on behalf of user
                                  Domain.com\extest_a6684afa10864
                                   Additional information:
                                   [Microsoft.Exchange.Data.Storage.WrongServerException]: The user and the mailbox are in different Active Directory sites..
    UserName                    : extest_a6684afa10864
    WARNING: No Client Access servers were tested.
    Test-OWAConnectivity from Active Copy Mailbox Server (***MBX02):
    WARNING: The test couldn't test the internal URL of this virtual directory, because the InternalURL property isn't set.
    Url                         :
    UrlType                     : Internal
    ClientAccessServerShortName : ***MBX02
    Scenario                    : Logon
    ScenarioDescription         : Sign in to Outlook Web App and verify the response page.
    PerformanceCounterName      :
    Result                      : Skipped
    Error                       : The test couldn't test the internal URL of this virtual directory, because the InternalURL property isn't set.
    WARNING: No Client Access servers were tested.
    Test-OWAConnectivity from CAS Server (***CAS01):
    WARNING: The test couldn't test the internal URL of this virtual directory, because the InternalURL property isn't set.
    Url                         :
    UrlType                     : Internal
    ClientAccessServerShortName : ***MBX02
    Scenario                    : Logon
    ScenarioDescription         : Sign in to Outlook Web App and verify the response page.
    PerformanceCounterName      :
    Result                      : Skipped
    Error                       : The test couldn't test the internal URL of this virtual directory, because the InternalURL property isn't set.
    WARNING: No Client Access servers were tested.

    Thank you for your help.
    I can access the URL from internet explorer.
    When I run Test-OwaConnectivity command I got an error {The specified computer isn't a Client Access server} while 1stSiteCAS01 is a CAS server:
    Test-OwaConnectivity -ClientAccessServer 1stSiteCAS01  -DomainController 1stSiteDC01
    The specified computer isn't a Client Access server.
        + CategoryInfo          : ObjectNotFound: (:) [Test-OwaConnectivity], LocalizedException
        + FullyQualifiedErrorId : [Server=1stSiteMBX02,RequestId=d090bd30-d813-4a5e-8f57-eec90d2b6fe7,TimeStamp=4/1/2015 7:13:07 AM] [FailureCategory=Cmdlet-LocalizedException]
    85112930,Microsoft.Exchange.
       Monitoring.TestOwaConnectivity
    Also, this is the result of Get-OwaVirtualDirectory command:
    Get-OwaVirtualDirectory | FL Identity,*Authentication*,*url*
    Identity                      : 2ndSiteEVS01\Exchange (Default Web Site)
    InternalAuthenticationMethods : {Basic, Ntlm, WindowsIntegrated}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : False
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 2ndSiteEVS01\Public (Default Web Site)
    InternalAuthenticationMethods : {Basic, Ntlm, WindowsIntegrated}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : False
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 2ndSiteEVS01\Exadmin (Default Web Site)
    InternalAuthenticationMethods : {Basic, Ntlm, WindowsIntegrated}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : False
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC01\Exchange (Default Web Site):ADObjectId)
    [Get-OwaVirtualDirectory], IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:13:38 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC02\Exchange (Default Web Site):ADObjectId)
    [Get-OwaVirtualDirectory], IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:13:38 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC01\Public (Default Web Site):ADObjectId) [Get-OwaVirtualDirectory],
    IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:13:38 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC01\Exchweb (Default Web Site):ADObjectId) [Get-OwaVirtualDirectory],
    IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:13:38 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC02\Exchweb (Default Web Site):ADObjectId) [Get-OwaVirtualDirectory],
    IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:13:38 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    Identity                      : 1stSiteHC01\Exchange (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC01\Exchweb (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC01\Public (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC02\Exchange (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC02\Exchweb (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC02\Public (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           :
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   :
    ExternalUrl                   :
    Identity                      : 1stSiteHC01\owa (Default
    Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           : {}
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   : https://1stSitehc01.domain.com/owa
    ExternalUrl                   : https://legacy.1stSite.domain.com/owa
    An IIS directory entry couldn't be created. The error message is Access is denied.
    . HResult = -2147024891
        + CategoryInfo          : NotInstalled: (2ndSiteHC01\owa (Default Web Site):ADObjectId) [Get-OwaVirtualDirectory],
    IISGeneralCOMException
        + FullyQualifiedErrorId : [Server=1stSiteMBX01,RequestId=84ddf2ec-04f5-40ab-8d90-b2a7fd756971,TimeStamp=4/1/2015 7:19:22 AM] [FailureCategory=Cmdlet-IISGeneralCOMException]
    1BEA286E,Microsoft.Excha
       nge.Management.SystemConfigurationTasks.GetOwaVirtualDirectory
        + PSComputerName        : 1stSitembx01.domain.com
    Identity                      : 1stSiteHC02\owa (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           : {}
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   : https://1stSitehc02.domain.com/owa
    ExternalUrl                   : https://legacy.1stSite.domain.com/owa
    Identity                      : 1stSiteCAS02\owa (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           : {}
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   : https://mail.1stSite.domain.com/owa
    ExternalUrl                   : https://mail.1stSite.domain.com/owa
    Identity                      : 1stSiteCAS01\owa (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           : {}
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   : https://mail.1stSite.domain.com/owa
    ExternalUrl                   : https://mail.1stSite.domain.com/owa
    Identity                      : 2ndSiteCAS01\owa (Default Web Site)
    InternalAuthenticationMethods : {Basic, Fba}
    BasicAuthentication           : True
    WindowsAuthentication         : False
    DigestAuthentication          : False
    FormsAuthentication           : True
    LiveIdAuthentication          : False
    AdfsAuthentication            : False
    OAuthAuthentication           : False
    ExternalAuthenticationMethods : {Fba}
    Url                           : {}
    SetPhotoURL                   :
    Exchange2003Url               :
    FailbackUrl                   :
    InternalUrl                   : https://mail.2ndSite.domain.com/owa
    ExternalUrl                   : https://mail.2ndSite.domain.com/owa

  • PS Dynamic Script for Test-Connection on OU and SubOU.

    I have a non working PowerShell script for searching an OU in an 2008 level Active directory, but it is obviously incomplete. I was able to retrieve part of the script from another forum (cant remember which one, or I would kindly give them the credit they
    deserve), but I was hoping to include a variable to in the "SearchBase" option below and make it dynamic, where I can change the OU to ping from a top level and have it also work under a child OU if I need to.
    Outcome: Ping OU and child OU and have the option to ping either selection. Of course I would manually enter in my Search base parameters when prompted from the shell. I just want to have any easy way of ping all computers from an OU level without having
    to paste the lower part of the script to my PowerShell script pane and changing the OU from there. If I can get the correct parameters working, then it would be easy to load this function to my PS profile. Thank you, and help is appreciated. Hoping someone
    can let me know what I am missing to get this functional.
    function
    get-DCping
    [CmdletBinding()]
    [Alias()]
    [OutputType([int])]
    Param
    # Param1 help description
    [Parameter(Mandatory=$true,
                       ValueFromPipelineByPropertyName
    =$true,
                       Position
    =0)]
    [string]$Search)
    $rtn
    =
    $null
    Get-ADComputer
    -Filter
    -SearchBase
    'OU=$Search,DC=domain,DC=domain' 
    |
    {$rtn
    =
    Test-Connection
    -CN
    $_.name
    -Count
    1
    -BufferSize
    16
    -Quiet
    IF
    ($rtn
    -match
    'True') {write-host
    -ForegroundColor
    green
    $_.name}
    ELSE
    { Write-host
    -ForegroundColor
    red
    $_.name }}

    Hi,
    Here's a starter:
    Function Get-DCPing {
    [CmdletBinding()]
    param(
    [string]
    $OrganizationalUnit
    Get-ADComputer -Filter * -SearchBase $OrganizationalUnit | ForEach {
    $computerName = $_.Name
    $props = @{
    ComputerName = $computerName
    Alive = $false
    If (Test-Connection -ComputerName $computerName -Count 1 -Quiet) {
    $props.Alive = $true
    New-Object PsObject -Property $props
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • [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)

  • BaseFileName cannot be nothing or an empty String during Test Connection

    Dear All,
    I have FDM+Foundation+HSF 11.1.2 installed
    I have stacked with the following problem:
    when I try to Test Connection (Authentication Provider Window) during Load Balance Configuration I am getting
    +“BaseFileName cannot be nothing or an empty String+
    Parameter name: value”
    Can somebody help me with it?
    Best Regards,
    Siarhei

    same error i faced, i restarted the APP server and it worked then.

  • Error while Test Connection with Connector

    hi all:
         there is an error while  Test Connection with Connector , I also test it through sys administration->sys configuration->
    suport -> sap transaction, I got all errors, I put these two errors as folows, could you please tell me how to sovle it
    ***************ERROR 1 while *error while Test Connection with Connector ******************************************************
    Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this
    system object
      Results
    Retrieval of default alias successful
    Connection failed. Make sure that Single Sign-On is configured correctly
    ************error sys administration->sys configuration-> suport -> sap transaction        ********************** 1.5 #0025B3E02892006100000A0800001798000487530FB0122E#1274690722265#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt
    .runtime#guodongdong#47472##n/a##690347f0670e11df98cc0025b3e02892#SAPEngine_Application_Thread[impl:3]
    9##0#0#Error##Java###04:4524/05/10_0077_6087550
    [EXCEPTION]
    #1#com.sapportals.portal.prt.runtime.PortalRuntimeException: Exception in SAP Application Integrator occured: Application URL
    &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid!
    Please check the protocol and host entries for system &\#39;sapdev&\#39;.
         at com.sapportals.portal.appintegrator.AbstractIntegratorComponent.doContentPass
    (AbstractIntegratorComponent.java:123)
         at com.sapportals.portal.appintegrator.AbstractIntegratorComponent.doContent(AbstractIntegratorComponent.java:98)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:523)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:412)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process
    (ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

    Hi,
    As per this part of the trace:
    Exception in SAP Application Integrator occured: Application URL &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid! Please check the protocol and host entries for system &\#39;sapdev&\#39;. at ...
    You can clearly see that the system object 'sapdev' is not configured correctly/at all - you are trying to launch transaction iView
    (WEBGUI) and in order to do so you should configure the 'internet transaction server' category of the system  object
    with the hostname of the ITS server.
    Generally the template is
    <System.Access.ITS.protocol>://<System.Access.ITS.hostname>/sap<ESID>/bc/gui/sap/its/webgui?\....
    So that's why you got
    Please check the protocol and host entries for system ..

  • Trying to modify a script to use test-connections in multiple domains?

    Hey Scripting Guy!
    I've created the script (below) to use test-connection against a list of hosts and write the results of the machines that respond to a .txt file. The only issue is that one of my sites utilizes two separate domains, does anyone have any advice as far as
    when a test connection fails, retrying the command using another domain name? (server.domain.com)
    I'll take any advice at this point... Thanks!
    New-PSDrive -Name S -PSProvider FileSystem -Root \\server\share -ErrorAction SilentlyContinue
    Get-ChildItem "S:\Folder1\Folder2\backup\backup Audits\Host Audits" -Filter *.txt | `
    Foreach-Object{
        $content = Get-Content $_.FullName
        #$SiteName = Get-ChildItem "S:\Folder1\Folder2\backup\backup Audits\Host Audits"
        #Find alive machines, and write their hostnames to output file for auditing
        Test-Connection -count 5 -ErrorAction SilentlyContinue $Content | Select-object -unique | Out-File      "S:\Folder1\Folder2\backup\backup Audits\Audit results by Site\$_"

    what i would like to do is when my test-connection fails with an error, append another domain suffix to the hostname so that if:
    test-connection computerxyz fails
    then test-connection computerxyz.domain.corp.com
    $server="$computer.domain1.com"
    if(Test-Connection $server -count 1 -quiet){
        $server="$computer.domain2.com"
        ... other code
    ¯\_(ツ)_/¯

  • I've had an iWeb site running for 4 months and I publish a monthly newsletter. Since August I've been unable to republish. The test connection under FTP settings works but I get an error message when I try to upload newsletter. Am I missing something mis

    I've had an iWeb site running for 4 months and I publish a monthly newsletter. Since August I've been unable to republish. The test connection under FTP settings works but I get an error message when I try to upload newsletter. Am I missing something?

    Where are you hosting the site a what are you using to upload the site files to the server?
    OT

  • Error in Test Connection - Content Repository does not exist

    Hi, I have created a content repository which points to our own external HTTP content server which is a DMS through transaction OAC0.
    In transaction CSADMIN I can see our server's status as running, still it shows yellow icon "customizing missing" in CSADMIN and in transaction OAC0 whenver I click "Test Connection" it gives the message" Content Repository does not exist". CMS 106.
    Kindly help.
    Regards
    Neha

    Hi,
    We are using OACO as follows:
    Choose Tools ® Business documents, Environment ® Knowledge Provider® KPro® Content Repositories
    Enter the following fields in the u201CChange Content Repositories : Detailu201D :-
    1) Content Rep. :- ZO (Content Repository Name)
    2) Description :- Content Repository
    3) Storage type :- HTTP content server.
    4) Version no :- 0045
    5) HTTP svr:p :- IP or machine name of application server on which DMS has been deployed : Web port of the application server on which DMS has been deployed.
    1) Program :- sap/sapDocView.jsp
    Save the created Content Repository by clicking on u201CSaveu201D. We are working on SAP 4.7 versionon a SAP development server and the content repository has not been transported after creation. Will not transporting be causing this error ?
    Please reward points
    Thanks
    Vikranth

  • Test Connection failed in Crystal Reports for Eclipse using SQL Server 2008

    I installed an SQL Server Express 2008 on my local PC (Window XP SP3). I downloaded sqljdbc4.jar to Crystal Reports for Eclipse
    IDE library path and tried to Test Connection, but got the Ping failed message : The TCP/IP connection to the host localhost, port 1433 has failed. It said that check that an instance of SQL Server is running on the host (I saw SQL Server SQLEXPRESS is Running on my PC) and accepting TCP/IP connection at the port (I enabled TCP/IPin my PC's SQL Server Network Configuration),
    and that no firewall is blocking TCP connection to the port(I turned OFF Window Firewall on my OC). Can anyone tell me how can I fix this problem ?

    Hi,
    Check the below thread also:
    http://scn.sap.com/thread/1634856
    Thanks,
    DJ

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • I'm trying to sign in on my account but an error sign come's up from window's saying test connection any ideas......

    I'm trying to sign in on my itunes account but windows error come's up saying test connection any ideas.....

    Make sure you have the right version...
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

Maybe you are looking for

  • Mapping in to SAP

    I have a scenario like this THis is for pharma company. product is having four operations. last one is compression like converting the powder in to tablets. so during this.. tablets weight is checked periodically for example for every 30 min for 10 t

  • What is the topic for this month?

    Hi, Has the 'topic of the month' feature, in SDN, been discontinued... It is nowhere seen in the home page. Just curious .. Thanks and Regards, - anto.

  • Word documents or pdf creation problems

    on my computer i haven't really much of a problem making a resume using a adobe's pdf or microsoft's word, and not problem emailing them and opening on the computer. but when i open the files of my resume on my iphone, the columns and structure of th

  • JSF:adding dynamic components on update.

    Well I am using a same form for two purposes. One if for creating a new service and one for editing it. In this I have a button on clicking it I get two new input text boxes. <h:panelGrid binding="#{provisioning.localPanelGrid}" />           <h:panel

  • Time Machine "missing" 2nd HD

    I have a new mac mini server - which has 2 1TB drives. Time machine is dutifully backing up the first drive (the system drive), but when I go into Time Machine to check on the backup of the 2nd drive - it's not there. I checked the Time Machine Prefe