New-SCPortACLRule
建立埠 ACL 規則。
Syntax
New-SCPortACLRule
[-VMMServer <ServerConnection>]
[-Name] <String>
[-Description <String>]
[-PortACL <PortACL>]
-Type <PortACLRuleDirection>
-Action <PortACLRuleAction>
[-LocalAddressPrefix <String>]
[-LocalPortRange <String>]
[-RemoteAddressPrefix <String>]
[-RemotePortRange <String>]
-Protocol <PortACLRuleProtocol>
-Priority <UInt16>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Description
New-SCPortACLRule Cmdlet 會為 Virtual Machine Manager (VMM) 建立埠存取控制清單 (ACL) 規則。
範例
範例 1:建立埠 ACL 規則
PS C:\> $PortACL = New-SCPortACL -Name "RDP ACL" -Description "Acl on RDP access"
PS: C:\> New-SCPortACLRule -Name "AllowRDPAccess" -PortACL $PortACL -Description "Allow RDP Rule from a subnet" -Action Allow -Type Inbound -Priority 110 -Protocol Tcp -LocalPortRange 3389 -RemoteAddressPrefix 10.184.20.0/24
第一個命令會建立埠 ACL,然後將它儲存在 $PortACL 變數中。
第二個命令建立通訊埠 ACL 規則,以允許來自遠端子網路的 RDP 存取。
參數
-Action
指定埠 ACL 規則動作。 此參數可接受的值為:
- 允許
- 拒絕
Type: | PortACLRuleAction |
Accepted values: | Allow, Deny |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定 ACL 規則的描述。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定追蹤工作進度,並將工作進度存放在這個參數命名的變數中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalAddressPrefix
指定本機位址首碼。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LocalPortRange
指定本機埠範圍。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定埠 ACL 規則的名稱。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUser
指定使用者名稱。 這個 Cmdlet 會代表此參數所指定的使用者運作。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUserRole
指定使用者角色。 若要取得使用者角色,請使用 Get-SCUserRole Cmdlet。 這個 Cmdlet 會代表此參數所指定的使用者角色運作。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PortACL
指定埠 ACL 物件。
Type: | PortACL |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Priority
指定優先順序。
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定觸發此動作 (PRO 提示) 效能和資源優化提示的識別碼。 此參數可讓您稽核 PRO 秘訣。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Protocol
指定通訊協定。 此參數可接受的值為:
- Tcp
- Udp
- 任意
Type: | PortACLRuleProtocol |
Accepted values: | Tcp, Udp, Any |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RemoteAddressPrefix
指定遠端位址首碼。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RemotePortRange
指定遠端埠範圍。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
表示作業會以非同步方式執行,讓控制項立即返回命令殼層。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Type
指定類型。 此參數可接受的值為:
- 連入
- 輸出
Type: | PortACLRuleDirection |
Accepted values: | Inbound, Outbound |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定 VMM 伺服器物件。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |