PowerShell Logo Small

Add-VMNetworkAdapterAcl



This is the built-in help made by Microsoft for the command 'Add-VMNetworkAdapterAcl', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates an ACL to apply to the traffic through a virtual machine network adapter.

SYNTAX


Add-VMNetworkAdapterAcl [-VMName] <String[]> [-ComputerName <String[]>] [-LocalIPAddress <String[]>] [-LocalMacAddress <String[]>] [-Passthru] [-RemoteIPAddress <String[]>]
[-RemoteMacAddress <String[]>] [-VMNetworkAdapterName <String>] -Action <VMNetworkAdapterAclAction> -Direction <VMNetworkAdapterAclDirection> [-Confirm] [-WhatIf]
[<CommonParameters>]
Add-VMNetworkAdapterAcl [-ComputerName <String[]>] [-LocalIPAddress <String[]>] [-LocalMacAddress <String[]>] [-Passthru] [-RemoteIPAddress <String[]>] [-RemoteMacAddress
<String[]>] [-VMNetworkAdapterName <String>] -Action <VMNetworkAdapterAclAction> -Direction <VMNetworkAdapterAclDirection> -ManagementOS [-Confirm] [-WhatIf]
[<CommonParameters>]
Add-VMNetworkAdapterAcl [-VM] <VirtualMachine[]> [-LocalIPAddress <String[]>] [-LocalMacAddress <String[]>] [-Passthru] [-RemoteIPAddress <String[]>] [-RemoteMacAddress
<String[]>] [-VMNetworkAdapterName <String>] -Action <VMNetworkAdapterAclAction> -Direction <VMNetworkAdapterAclDirection> [-Confirm] [-WhatIf] [<CommonParameters>]
Add-VMNetworkAdapterAcl [-VMNetworkAdapter] <VMNetworkAdapterBase[]> [-LocalIPAddress <String[]>] [-LocalMacAddress <String[]>] [-Passthru] [-RemoteIPAddress <String[]>]
[-RemoteMacAddress <String[]>] -Action <VMNetworkAdapterAclAction> -Direction <VMNetworkAdapterAclDirection> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Add-VMNetworkAdapterAcl cmdlet creates an ACL to apply to the traffic through a virtual machine network adapter.
When a virtual network adapter is created there is no ACL on it. Given a list of IP-based ACL entries to be applied to traffic in the same direction, the longest match rule
decides which one of the entries is most appropriate to apply to a specific packet.



<

RELATED LINKS


Online Version: http://go.microsoft.com/fwlink/?LinkID=306813

REMARKS

<

Examples


Example 1

PS C:\>Add-VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress 10.0.0.0/8 –Direction Both –Action Allow



This example adds an ACL to allow virtual machine Redmond to send to and receive from traffic on IP subnet 10.0.0.8/8.




Example 2

PS C:\>Add-VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress ANY –Direction Both –Action Deny



This example adds an ACL to deny virtual machine Redmond to send either IPv4 or IPv6 traffic to anywhere and receive such traffic from anywhere.




Example 3

PS C:\>Get-VM Redmond | Add-VMNetworkAdapterAcl -RemoteMacAddress 03-0f-01-0e-aa-b2 -Direction Both -Action Deny



This example gets virtual machine Redmond and adds an ACL to deny it to send any traffic to a device with MAC address 03-0f-01-0e-aa-b2 or to receive any traffic from that
device.




Example 4

PS C:\>Get-VMNetworkAdapter -VMName Redmond | Add-VMNetworkAdapterAcl -RemoteIPAddress 192.168.0.0/16 -Direction Outbound -Action Meter



This example gets virtual network adapters from virtual machine Redmond and adds an ACL to meter outgoing traffic sent to IP subnet 192.168.0.0/16.