Skip to content

Instantly share code, notes, and snippets.

@jalex19100
Created September 26, 2015 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalex19100/ca928bf48036d8758b4d to your computer and use it in GitHub Desktop.
Save jalex19100/ca928bf48036d8758b4d to your computer and use it in GitHub Desktop.
Modify Azure VM ACL with Powershell
$name = "myVM"
$acl1 = New-AzureAclConfig
$vm = Get-AzureVM -ServiceName $name -Name $name
Set-AzureAclConfig -AddRule -ACL $acl1 -Order 100 -Action permit -RemoteSubnet "X.X.0.0/16" -Description "rule1"
Set-AzureAclConfig -AddRule -ACL $acl1 -Order 200 -Action permit -RemoteSubnet "X.X.0.0/16" -Description "rule2"
$vm | Get-AzureEndpoint | ForEach-Object {Set-AzureEndpoint -ACL $acl1 -Nam
e $_.Name -VM $vm}
Update-AzureVM -ServiceName $name -Name $name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment