Skip to content

Commit 0a332cf

Browse files
new example 4/workaround (#16437)
* new example 4/workaround * Update src/Network/Network/help/Set-AzNetworkSecurityRuleConfig.md Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com> Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com>
1 parent 5fa9596 commit 0a332cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Network/Network/help/Set-AzNetworkSecurityRuleConfig.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ Updates a network security rule configuration for a network security group. (aut
6767
Set-AzNetworkSecurityRuleConfig -Access Allow -Description 'Allow RDP' -DestinationAddressPrefix * -DestinationPortRange 3389 -Direction Inbound -Name 'rdp-rule' -NetworkSecurityGroup <PSNetworkSecurityGroup> -Priority 1 -Protocol Tcp -SourceAddressPrefix 'Internet' -SourcePortRange *
6868
```
6969

70+
### Example 4
71+
72+
Updates a network security rule configuration for a network security group (Source IP address)
73+
74+
```powershell
75+
$nsg = Get-AzNetworkSecurityGroup -ResourceGroupName "MyResource" -Name "MyNsg"
76+
($nsg.SecurityRules | Where-Object {$_.Name -eq "RuleName"}).SourceAddressPrefix = ([System.String[]] @("xxx.xxx.xxx.xxx"))
77+
$nsg | Set-AzNetworkSecurityGroup | Get-AzNetworkSecurityRuleConfig -Name "RuleName"
78+
```
79+
7080
## PARAMETERS
7181

7282
### -Access

0 commit comments

Comments
 (0)