New-SCPortACLRule
创建端口 ACL 规则。
语法
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>]
说明
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 提示) 的性能和资源优化提示的 ID。 此参数允许审核 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
指示作业异步运行,以便控件立即返回到命令 shell。
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 |