zoukankan      html  css  js  c++  java
  • [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[0] -Description $myNewACL[1]

    $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

  • 相关阅读:
    【ccf线上赛普及组 2020】
    【小总结】2020.3.6
    DP优化
    noip2012day2
    noip2012day1
    3.28真题
    数据结构总结
    noi online 普及组
    小总结
    20200229模拟赛
  • 原文地址:https://www.cnblogs.com/wuzhenzhou/p/6909665.html
Copyright © 2011-2022 走看看