你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Set-AzNetworkWatcherConnectionMonitor
更新连接监视器资源。
语法
Set-AzNetworkWatcherConnectionMonitor
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-Location <String>
-Name <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-Location <String>
-Name <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-ResourceId <String>
-SourceResourceId <String>
[-MonitoringIntervalInSeconds <Int32>]
[-SourcePort <Int32>]
[-DestinationResourceId <String>]
-DestinationPort <Int32>
[-DestinationAddress <String>]
[-ConfigureOnly]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-ResourceId <String>
-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzNetworkWatcherConnectionMonitor
-InputObject <PSConnectionMonitorResult>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-AzNetworkWatcherConnectionMonitor cmdlet 更新连接监视器资源。
示例
示例 1:更新连接监视器
Set-AzNetworkWatcherConnectionMonitor -Location centraluseuap -Name cm -SourceResourceId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RgCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm `
-DestinationAddress google.com -DestinationPort 80 -Tag @{"key1" = "value1"}
Name : cm
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGro
ups/NetworkWatcherRG/providers/Microsoft.Network/networkWatcher
s/NetworkWatcher_centraluseuap/connectionMonitors/cm
Etag : W/"5b2b20e8-0ce0-417e-9607-76208149bb67"
ProvisioningState : Succeeded
Source : {
"ResourceId": "/subscriptions/00000000-0000-0000-0000-0000000
00000/RgCentralUSEUAP/providers/Microsoft.Compute/virtualMach
ines/vm",
"Port": 0
}
Destination : {
"Address": "google.com",
"Port": 80
}
MonitoringIntervalInSeconds : 60
AutoStart : True
StartTime : 1/12/2018 7:19:28 PM
MonitoringStatus : Running
Location : centraluseuap
Type : Microsoft.Network/networkWatchers/connectionMonitors
Tags : {
"key1": "value1"
}
在此示例中,我们通过更改 destinationAddress 并添加标记来更新现有连接监视器。
参数
-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 |
-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 |
-InputObject
连接监视器对象。
类型: | PSConnectionMonitorResult |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | 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 |
-ResourceId
ConnectionMonitor 资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | 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 |