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

Set-AzNetworkManagerSecurityUserRule

更新网络管理器安全用户规则。

语法

Set-AzNetworkManagerSecurityUserRule
   -InputObject <PSNetworkManagerSecurityUserRule>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkManagerSecurityUserRule
   -Name <String>
   -ResourceGroupName <String>
   -NetworkManagerName <String>
   -SecurityUserConfigurationName <String>
   -RuleCollectionName <String>
   [-Description <String>]
   -Protocol <String>
   -Direction <String>
   [-SourceAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
   [-DestinationAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
   [-SourcePortRange <String[]>]
   [-DestinationPortRange <String[]>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzNetworkManagerSecurityUserRule
   -ResourceId <String>
   [-Description <String>]
   -Protocol <String>
   -Direction <String>
   [-SourceAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
   [-DestinationAddressPrefix <PSNetworkManagerAddressPrefixItem[]>]
   [-SourcePortRange <String[]>]
   [-DestinationPortRange <String[]>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

说明

Set-AzNetworkManagerSecurityUserRule cmdlet 更新网络安全用户规则。

示例

示例 1

$SecurityUserRule = Get-AzNetworkManagerSecurityUserRule  -Name "psRule" -RuleCollectionName "psRuleCollection" -SecurityUserConfigurationName "psSecurityUserConfig" -NetworkManagerName "psNetworkManager" -ResourceGroupName "psResourceGroup"
Set-AzNetworkManagerSecurityUserRule -InputObject $SecurityUserRule

Protocol                  : Tcp
Direction                 : Inbound
Sources                   : {Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerAddressPrefixItem}
Destinations              : {Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerAddressPrefixItem}
SourcePortRanges          : {100}
DestinationPortRanges     : {99}
SourcesText               : [
                              {
                                "AddressPrefix": "Internet",
                                "AddressPrefixType": "ServiceTag"
                              }
                            ]
DestinationsText          : [
                              {
                                "AddressPrefix": "10.0.0.1",
                                "AddressPrefixType": "IPPrefix"
                              }
                            ]
SourcePortRangesText      : [
                              "100"
                            ]
DestinationPortRangesText : [
                              "99"
                            ]
DisplayName               :
Description               : TestDescription
Type                      : Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections/rules
ProvisioningState         : Succeeded
SystemData                : Microsoft.Azure.Commands.Network.Models.NetworkManager.PSSystemData
SystemDataText            : {
                               "CreatedBy": "00000000-0000-0000-0000-000000000000",
                               "CreatedByType": "Application",
                               "CreatedAt": "2021-10-18T04:05:57",
                               "LastModifiedBy": "00000000-0000-0000-0000-000000000000",
                               "LastModifiedByType": "Application",
                               "LastModifiedAt": "2021-10-18T04:05:59"
                            }
Name                      : psRule
Etag                      :
Id                        : /subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b/resourceGroups/psResourceGroup/providers/Microsoft.Network/networkManagers/psNetworkManager/securityUserConfigurations/psSecurityUserConfig/ruleCollections/psRuleCollection/rules/psRule

更新网络安全用户规则的优先级”。

参数

-AsJob

在后台运行 cmdlet

类型: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

-Description

描述。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-DestinationAddressPrefix

目标地址前缀。

类型:PSNetworkManagerAddressPrefixItem[]
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-DestinationPortRange

目标端口范围。

类型:String[]
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Direction

规则方向。 有效值包括“Inbound”和“Outbound”。

类型:String
接受的值:Inbound, Outbound
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-InputObject

网络管理器安全用户规则

类型:PSNetworkManagerSecurityUserRule
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Name

资源名称。

类型:String
别名:ResourceName
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:True

-NetworkManagerName

网络管理器名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-Protocol

规则协议。 有效值包括“Tcp”、“Udp”、“Icmp”、“Esp”、“Any”和“Ah”。

类型:String
接受的值:Tcp, Udp, Icmp, Esp, Any, Ah
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ResourceGroupName

资源组名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-ResourceId

NetworkManager SecurityUserRule Id

类型:String
别名:SecurityUserRuleId
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-RuleCollectionName

规则集合名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-SecurityUserConfigurationName

安全用户配置名称。

类型:String
别名:ConfigName
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-SourceAddressPrefix

源地址前缀。

类型:PSNetworkManagerAddressPrefixItem[]
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-SourcePortRange

源端口范围。

类型:String[]
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

String

Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerSecurityBaseUserRule

输出

Microsoft.Azure.Commands.Network.Models.NetworkManager.PSNetworkManagerSecurityBaseUserRule