< Back

Test-AzureRmNetworkWatcherConnectivity

Tue Jan 29, 2019 9:58 pm

NAME Test-AzureRmNetworkWatcherConnectivity



SYNOPSIS

Returns connectivity information for a specified source VM and a destination.





SYNTAX

Test-AzureRmNetworkWatcherConnectivity [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-DestinationAddress <String>] [-DestinationId

<String>] [-DestinationPort <Int32>] -NetworkWatcher <PSNetworkWatcher> -SourceId <String> [-SourcePort <Int32>] [<CommonParameters>]



Test-AzureRmNetworkWatcherConnectivity [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-DestinationAddress <String>] [-DestinationId

<String>] [-DestinationPort <Int32>] -NetworkWatcherName <String> -ResourceGroupName <String> -SourceId <String> [-SourcePort <Int32>]

[<CommonParameters>]





DESCRIPTION

The Test-AzureRmNetworkWatcherConnectivity cmdlet returns connectivity information for a specified source VM and a destination. If connectivity

between the source and destination cannot be established, the cmdlet returns details about the issue.





PARAMETERS

-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DestinationAddress <String>

The IP address or URI the resource to which a connection attempt will be made.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DestinationId <String>

The ID of the resource to which a connection attempt will be made.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DestinationPort <Int32>

Port on which check connectivity will be performed.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NetworkWatcher <PSNetworkWatcher>

The network watcher resource.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-NetworkWatcherName <String>

The name of network watcher.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

The name of the network watcher resource group.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SourceId <String>

The ID of the resource from which a connectivity check will be initiated.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SourcePort <Int32>

The source port from which a connectivity check will be performed.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Microsoft.Azure.Commands.Network.Models.PSNetworkWatcher

System.String System.Int32





OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSConnectivityInformation







NOTES





Keywords: azure, azurerm, arm, resource, connectivity, management, manager, network, networking, network watcher



--------------- Example 1: Test Network Watcher Connectivity from a VM to a website ---------------



Test-AzureRmNetworkWatcherConnectivity -NetworkWatcherName NetworkWatcher -ResourceGroupName NetworkWatcherRG -SourceId

"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"

-DestinationAddress "bing.com" -DestinationPort 80





ConnectionStatus : Reachable

AvgLatencyInMs : 4

MinLatencyInMs : 2

MaxLatencyInMs : 15

ProbesSent : 15

ProbesFailed : 0

Hops : [

{

"Type": "Source",

"Id": "f8cff464-e13f-457f-a09e-4dcd53d38a85",

"Address": "10.1.1.4",

"ResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ContosoRG/provi

iders/Microsoft.Network/networkInterfaces/appNic0/ipConfigurations/ipconfig1",

"NextHopIds": [

"1034b1bf-0b1b-4f0a-93b2-900477f45485"

],

"Issues": []

},

{

"Type": "Internet",

"Id": "1034b1bf-0b1b-4f0a-93b2-900477f45485",

"Address": "13.107.21.200",

"ResourceId": "Internet",

"NextHopIds": [],

"Issues": []

}

]



In this example we test connectivity from a VM in Azure to www.bing.com.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... nnectivity

New-AzureRmNetworkWatcher

Get-AzureRmNetworkWatcher

Remove-AzureRmNetworkWatcher

Get-AzureRmNetworkWatcherNextHop

Get-AzureRmNetworkWatcherSecurityGroupView

Get-AzureRmNetworkWatcherTopology

Get-AzureRmNetworkWatcherTroubleshootingResult

New-AzureRmNetworkWatcherPacketCapture

New-AzureRmPacketCaptureFilterConfig

Get-AzureRmNetworkWatcherPacketCapture

Remove-AzureRmNetworkWatcherPacketCapture

Stop-AzureRmNetworkWatcherPacketCapture