New-SCPortACLRule

Creates a port ACL rule.

Syntax

New-SCPortACLRule [-Name] <String> -Action <PortACLRuleAction> [-Description <String>] [-JobVariable <String>]
 [-LocalAddressPrefix <String>] [-LocalPortRange <String>] [-OnBehalfOfUser <String>]
 [-OnBehalfOfUserRole <UserRole>] [-PROTipID <Guid>] [-PortACL <PortACL>] -Priority <UInt16>
 -Protocol <PortACLRuleProtocol> [-RemoteAddressPrefix <String>] [-RemotePortRange <String>]
 [-RunAsynchronously] -Type <PortACLRuleDirection> [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The New-SCPortACLRule cmdlet creates a port access control list (ACL) rule for Virtual Machine Manager (VMM).

Examples

Example 1: Create a port ACL rule

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

The first command creates a port ACL, and then stores it in the $PortACL variable.

The second command creates a port ACL rule to allow RDP access from a remote subnet.

Parameters

-Action

Specifies a port ACL rule action. The acceptable values for this parameter are:

- Allow

  • Deny

Type:PortACLRuleAction
Parameter Sets:Allow, Deny
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the ACL rule.

Type:String
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LocalAddressPrefix

Specifies the local address prefix.

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

Specifies the local port range.

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

Specifies the name of the port ACL rule.

Type:String
Required:True
Position:0
Default value:None
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
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PortACL

Specifies a port ACL object.

Type:PortACL
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Priority

Specifies the priority.

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

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

- Tcp

  • Udp
  • Any

Type:PortACLRuleProtocol
Parameter Sets:Tcp, Udp, Any
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RemoteAddressPrefix

Specifies the remote address prefix.

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

Specifies the remote port range.

Type:String
Required:False
Position:Named
Default value:None
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Type

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

- Inbound

  • Outbound

Type:PortACLRuleDirection
Parameter Sets:Inbound, Outbound
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

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