PowerShell ile Network Security Group icine Kural Eklemek

Ortaminizdaki Network Security Group’lari (NSG) PowerShell ile yonetmek son derece basittir. Yeni bir kural eklemek istediginizde asagidaki komut kumesini kullanabilirsiniz.

$networkSecurityGroup = Get-AzNetworkSecurityGroup -Name “testnsg1” -ResourceGroupName “hub-network”

$networkSecurityGroup | Add-AzNetworkSecurityRuleConfig -Name "rule1"
-Description “RDP port izni” -Access Allow
-Protocol * -Direction Inbound
-Priority 100 -SourceAddressPrefix "*"
-SourcePortRange * -DestinationAddressPrefix *
-DestinationPortRange 3389

$networkSecurityGroup | Set-AzNetworkSecurityGroup

Portal icinden konfirme edebilirsiniz.

Leave a Reply

Your email address will not be published.