你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzNetworkWatcherConnectionMonitorObject

Create a connection monitor V2 object.

Syntax

New-AzNetworkWatcherConnectionMonitorObject
   -NetworkWatcher <PSNetworkWatcher>
   -Name <String>
   [-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
   [-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
   [-Note <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzNetworkWatcherConnectionMonitorObject
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -Name <String>
   [-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
   [-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
   [-Note <String>]
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Location of the network watcher.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The connection monitor name.

Type:String
Aliases:ConnectionMonitorName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcher

The network watcher resource.

Type:PSNetworkWatcher
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcherName

The name of network watcher.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Note

Notes associated with connection monitor.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Output

Describes a connection monitor output destinations.

Type:PSNetworkWatcherConnectionMonitorOutputObject[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the network watcher resource group.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Tag

A hashtable which represents resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TestGroup

The list of test groups.

Type:PSNetworkWatcherConnectionMonitorTestGroupObject[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSNetworkWatcherConnectionMonitorObject