Created
November 7, 2014 03:12
-
-
Save andreaswasita/6f57990746e36f9240f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a Network Security Group | |
New-AzureNetworkSecurityGroup -Name "DMZ_NSG" -Location Southeast Asia -Label "DMZ NSG SEVNET" | |
#Add, Update Rules to a NSG | |
Get-AzureNetworkSecurityGroup -Name "DMZ_NSG" | Set-AzureNetworkSecurityRule -Name RDPInternet-DMZ -Type Inbound -Priority 347 -Action Allow -SourceAddressPrefix 'INTERNET' -SourcePortRange '63389' -DestinationAddressPrefix '10.0.2.0/25' -DestinationPortRange '63389' -Protocol TCP | |
#Delete a rule from NSG | |
Get-AzureNetworkSecurityGroup -Name "DMZ_NSG" | Remove-AzureNetworkSecurityRule -Name RDPInternet-DMZ | |
#Associate a NSG to a Virtual machine | |
Get-AzureVM -ServiceName "Proxy01" -Name "azproxy01" | Set-AzureNetworkSecurityGroupConfig -NetworkSecurityGroupName "DMZ_NSG" | |
#Remove a NSG from a VM | |
Get-AzureVM -ServiceName "Proxy01" -Name "azproxy01" | Remove-AzureNetworkSecurityGroupConfig -NetworkSecurityGroupName "DMZ_NSG" | |
#Associate a NSG to a subnet | |
Get-AzureNetworkSecurityGroup -Name "DMZ_NSG" | Set-AzureNetworkSecurityGroupToSubnet -VirtualNetworkName 'SEVNET' -SubnetName 'Azure DMZ Subnet' | |
#Remove a NSG from the subnet | |
Get-AzureNetworkSecurityGroup -Name "DMZ_NSG" | Remove-AzureNetworkSecurityGroupFromSubnet -VirtualNetworkName 'SEVNET' -SubnetName 'Azure DMZ Subnet' | |
#Delete a NSG | |
Remove-AzureNetworkSecurityGroup -Name "DMZ_NSG" | |
#Get Details of Network Secuirty group along with rules | |
Get-AzureNetworkSecurityGroup -Name "DMZ_NSG" -Detailed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment