Set-SCPortACLRule

Modifies a port ACL rule.

Syntax

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>]

Description

The Set-SCPortACLRule cmdlet modifies a port access control list (ACL) rule in Virtual Machine Manager (VMM).

Examples

Example 1: Modify the port ACL rule priority

PS C:\> $PortACLRule = Get-SCPortACLRule -Name "AllowRDPAccess"
PS: C:\> Set-SCPortACLRule -PortACLRule $PortACLRule -Priority 220"

The first command gets the port ACL rule named AllowRDPAccess, and then stores it in the $PortACLRule variable.

The second command changes the priority of the rule in $PortACLRule to 220.

Example 2: Modify the port acl rule remote address range and protocol

PS C:\> $PortACLRule = Get-SCPortACLRule -Name "AllowRDPAccess"
PS: C:\> Set-SCPortACLRule -PortACLRule $portACLRule -RemoteAddressPrefix 172.185.21.0/24 -Protocol Udp

The first command gets the port ACL rule named AllowRDPAccess, and then stores it in the $PortACLRule variable.

The second command changes the protocol of the ACL rule in $PortACLRule to UDP and sets the remote address range to a different subnet.

Parameters

-Action

Specifies a port ACL rule action object.

Type:PortACLRuleAction
Accepted values:Allow, Deny
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the port ACL rule.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LocalAddressPrefix

Specifies the local address prefix.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LocalPortRange

Specifies the local port range.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the port ACL rule.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PortACLRule

Specifies the port ACL rule to modify.

Type:PortACLRule
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Priority

Specifies the priority.

Type:UInt16
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Protocol

Specifies the protocol. The acceptable values for this parameter are:

  • Tcp
  • Udp
  • Any
Type:PortACLRuleProtocol
Accepted values:Tcp, Udp, Any
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemoteAddressPrefix

Specifies the remote address prefix.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemotePortRange

Specifies the remote port range.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Type

Specifies the type. The acceptable values for this parameter are:

  • Inbound
  • Outbound
Type:PortACLRuleDirection
Accepted values:Inbound, Outbound
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False