Set-SCPortACLRule
修改端口 ACL 规则。
语法
Set-SCPortACLRule
[-VMMServer <ServerConnection>]
[-PortACLRule] <PortACLRule>
[-Name <String>]
[[-Description] <String>]
[-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>]
说明
Set-SCPortACLRule cmdlet 修改 Virtual Machine Manager ( (VMM) 中的 ACL) 规则的端口访问控制列表。
示例
示例 1:修改端口 ACL 规则优先级
PS C:\> $PortACLRule = Get-SCPortACLRule -Name "AllowRDPAccess"
PS: C:\> Set-SCPortACLRule -PortACLRule $PortACLRule -Priority 220"
第一个命令获取名为 AllowRDPAccess 的端口 ACL 规则,然后将其存储在$PortACLRule变量中。
第二个命令将$PortACLRule中的规则优先级更改为 220。
示例 2:修改端口 acl 规则远程地址范围和协议
PS C:\> $PortACLRule = Get-SCPortACLRule -Name "AllowRDPAccess"
PS: C:\> Set-SCPortACLRule -PortACLRule $portACLRule -RemoteAddressPrefix 172.185.21.0/24 -Protocol Udp
第一个命令获取名为 AllowRDPAccess 的端口 ACL 规则,然后将其存储在$PortACLRule变量中。
第二个命令将 $PortACLRule ACL 规则的协议更改为 UDP,并将远程地址范围设置为其他子网。
参数
-Action
指定端口 ACL 规则操作对象。
Type: | PortACLRuleAction |
Accepted values: | Allow, Deny |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定端口 ACL 规则的说明。
Type: | String |
Position: | 1 |
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: | Named |
Default value: | None |
Required: | False |
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 |
-PortACLRule
指定要修改的端口 ACL 规则。
Type: | PortACLRule |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Priority
指定优先级。
Type: | UInt16 |
Position: | Named |
Default value: | None |
Required: | False |
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: | False |
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: | False |
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 |