你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzNetworkWatcherConnectionMonitor
创建连接监视器资源。
语法
New-AzNetworkWatcherConnectionMonitor
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-Location <String>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-Location <String>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitor
-ConnectionMonitor <PSNetworkWatcherConnectionMonitorObject>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzNetworkWatcherConnectionMonitor cmdlet 为指定的源和目标(SingleSourcedestination 连接监视器)或测试组(MultiEndpointConnectionMonitor)创建连接监视器资源。
示例
示例 1
New-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name cm -SourceResourceId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RgCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm -DestinationAddress bing.com -DestinationPort 80
Name : cm
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGro
ups/NetworkWatcherRG/providers/Microsoft.Network/networkWatcher
s/NetworkWatcher_centraluseuap/connectionMonitors/t1
Etag : W/"e86b28cf-b907-4475-a8b7-34d310367694"
ProvisioningState : Succeeded
Source : {
"ResourceId": "/subscriptions/00000000-0000-0000-0000-0000000
00000/resourceGroups/RgCentralUSEUAP/providers/Microsoft
.Compute/virtualMachines/vm",
"Port": 0
}
Destination : {
"Address": "bing.com",
"Port": 80
}
MonitoringIntervalInSeconds : 60
AutoStart : True
StartTime : 1/12/2018 7:13:11 PM
MonitoringStatus : Running
Location : centraluseuap
Type : Microsoft.Network/networkWatchers/connectionMonitors
Tags : {}
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConfigureOnly
配置连接监视器,但不要启动它
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ConnectionMonitor
连接监视器对象。
类型: | PSNetworkWatcherConnectionMonitorObject |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationAddress
连接监视器目标(IP 或域名)的地址。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationPort
连接监视器使用的目标端口。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DestinationResourceId
连接监视器用作目标的资源的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
如果想要覆盖资源,请不要要求确认
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
网络观察程序的位置。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-MonitoringIntervalInSeconds
监视间隔(以秒为单位)。 默认值为 60 秒。
类型: | Nullable<T>[Int32] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
连接监视器名称。
类型: | String |
别名: | ConnectionMonitorName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NetworkWatcher
网络观察程序资源。
类型: | PSNetworkWatcher |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-NetworkWatcherName
网络观察程序的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Note
与连接监视器关联的注释。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Output
描述连接监视器输出目标。
类型: | PSNetworkWatcherConnectionMonitorOutputObject[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
网络观察程序资源组的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SourcePort
连接监视器使用的源端口。
类型: | Int32 |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SourceResourceId
连接监视器用作源的资源的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Tag
表示资源标记的哈希表。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TestGroup
测试组的列表。
类型: | PSNetworkWatcherConnectionMonitorTestGroupObject[] |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
List<T>[[Microsoft.Azure.Commands.Network.Models.PSNetworkWatcherConnectionMonitorTestGroupObject, Microsoft.Azure.PowerShell.Cmdlets.Network, Version=2.2.2.0, Culture=neutral, PublicKeyToken=null]]
List<T>[[Microsoft.Azure.Commands.Network.Models.PSNetworkWatcherConnectionMonitorOutputObject, Microsoft.Azure.PowerShell.Cmdlets.Network, Version=2.2.2.0, Culture=neutral, PublicKeyToken=null]]