woxio770 发表于 2017-6-30 22:33:02

[Azure][PowerShell][ASM][12]ACL

  $mySubscriptionName="运维环境"
  Select-AzureSubscription -SubscriptionName $mySubscriptionName
  $myServiceName="云服务名称"
  $myVMName="虚拟机名称"
  $myEndPoint="终结点名称"
  $myACL=New-AzureAclConfig
  $myRemoteSubnet="x.x.x.x/32"
  $myDescription="描述"
  $myID=0
  $myACL = Get-AzureVM -ServiceName $myServiceName -Name $myVMName | Get-AzureAclConfig -EndpointName $myEndPoint
  $myNewACLs=
  ( "x.x.x.x/32","描述"),
  ( "x.x.x.x/32","描述"),
  ( "x.x.x.x/32","描述"),
  ( "x.x.x.x/32","描述"),
  ( "x.x.x.x/32","描述"),
  ( "x.x.x.x/32","描述")
  foreach($myNewACL in $myNewACLs)
  {
  Set-AzureAclConfig -AddRule -ACL $myACL -Order $myID -Action Permit -RemoteSubnet $myNewACL -Description $myNewACL
  $myID=$myID + 1
  }
  #$remoteSubnet="172.0.0.0/8"
  #$description="20"
  # Set-AzureAclConfig -AddRule -ACL $myACL -Order $myID -Action Permit -RemoteSubnet $myRemoteSubnet -Description $myDescription
  Get-AzureVM -ServiceName $myServiceName -Name $myVMName | Set-AzureEndpoint -ACL $myACL -Name $myEndPoint | Update-AzureVM
页: [1]
查看完整版本: [Azure][PowerShell][ASM][12]ACL