New-AzNetworkWatcherConnectionMonitorObject
Create a connection monitor V2 object.
Syntax
SetByResource
New-AzNetworkWatcherConnectionMonitorObject
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetByName
New-AzNetworkWatcherConnectionMonitorObject
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SetByLocation
New-AzNetworkWatcherConnectionMonitorObject
-Location <String>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzNetworkWatcherConnectionMonitorObject cmdlet creates a connection monitor V2 object.
Examples
Example 1
$cmtest = New-AzNetworkWatcherConnectionMonitorObject -Location westcentralus -Name cmV2test -TestGroup $testGroup1, $testGroup2 -Tag @{"name" = "value"}
$cmtest
NetworkWatcherName : NetworkWatcher_westcentralus
ResourceGroupName : NetworkWatcherRG
Name : cmV2test
TestGroups : [
{
"Name": "testGroup1",
"Disable": false,
"TestConfigurations": [
{
"Name": "tcpTC",
"TestFrequencySec": 60,
"ProtocolConfiguration": {
"Port": 80,
"DisableTraceRoute": false
},
"SuccessThreshold": {
"ChecksFailedPercent": 20,
"RoundTripTimeMs": 5
}
},
{
"Name": "icmpTC",
"TestFrequencySec": 30,
"PreferredIPVersion": "IPv4",
"ProtocolConfiguration": {
"DisableTraceRoute": true
}
}
],
"Sources": [
{
"Name": "MultiTierApp0(IrinaRGWestcentralus)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/RGW
estcentralus/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"
},
{
"Name": "NPM-CommonEUS(er-lab)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/er-lab/p
roviders/Microsoft.OperationalInsights/workspaces/NPM-CommonEUS",
"Filter": {
"Type": "Include",
"Items": [
{
"Type": "AgentAddress",
"Address": "SEA-Cust50-VM01"
},
{
"Type": "AgentAddress",
"Address": "WIN-P0HGNDO2S1B"
}
]
}
}
],
"Destinations": [
{
"Name": "bingEndpoint",
"Address": "bing.com"
},
{
"Name": "googleEndpoint",
"Address": "google.com"
}
]
},
{
"Name": "testGroup2",
"Disable": false,
"TestConfigurations": [
{
"Name": "httpTC",
"TestFrequencySec": 120,
"ProtocolConfiguration": {
"Port": 443,
"Method": "GET",
"RequestHeaders": [
{
"Name": "Allow",
"Value": "GET"
}
],
"ValidStatusCodeRanges": [
"2xx",
"300-308"
],
"PreferHTTPS": true
},
"SuccessThreshold": {
"ChecksFailedPercent": 20,
"RoundTripTimeMs": 30
}
}
],
"Sources": [
{
"Name": "MultiTierApp0(IrinaRGWestcentralus)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/IrinaRGW
estcentralus/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"
}
],
"Destinations": [
{
"Name": "googleEndpoint",
"Address": "google.com"
}
]
}
]
Outputs : null
Notes :
Tags : {
"name": "value"
}
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Location
Location of the network watcher.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByLocation
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The connection monitor name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ConnectionMonitorName
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-NetworkWatcher
The network watcher resource.
Parameter properties
Type: PSNetworkWatcher
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByResource
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-NetworkWatcherName
The name of network watcher.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Note
Notes associated with connection monitor.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Output
Describes a connection monitor output destinations.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The name of the network watcher resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Tag
A hashtable which represents resource tags.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TestGroup
The list of test groups.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
None
Outputs