Remove-VMNetworkAdapterAcl
Remove-VMNetworkAdapterAcl
Removes an ACL applied to the traffic through a virtual network adapter.
語法
Parameter Set: VMName
Remove-VMNetworkAdapterAcl [-VMName] <String[]> -Action <VMNetworkAdapterAclAction> {Allow | Deny | Meter} -Direction <VMNetworkAdapterAclDirection> {Inbound | Outbound | Both} [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-LocalIPAddress <String[]> ] [-LocalMacAddress <String[]> ] [-Passthru] [-RemoteIPAddress <String[]> ] [-RemoteMacAddress <String[]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: InputObjectParameter
Remove-VMNetworkAdapterAcl [-InputObject] <VMNetworkAdapterAclSetting[]> [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ManagementOS
Remove-VMNetworkAdapterAcl -Action <VMNetworkAdapterAclAction> {Allow | Deny | Meter} -Direction <VMNetworkAdapterAclDirection> {Inbound | Outbound | Both} -ManagementOS [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-LocalIPAddress <String[]> ] [-LocalMacAddress <String[]> ] [-Passthru] [-RemoteIPAddress <String[]> ] [-RemoteMacAddress <String[]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ResourceObject
Remove-VMNetworkAdapterAcl [-VMNetworkAdapter] <VMNetworkAdapterBase[]> -Action <VMNetworkAdapterAclAction> {Allow | Deny | Meter} -Direction <VMNetworkAdapterAclDirection> {Inbound | Outbound | Both} [-LocalIPAddress <String[]> ] [-LocalMacAddress <String[]> ] [-Passthru] [-RemoteIPAddress <String[]> ] [-RemoteMacAddress <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Remove-VMNetworkAdapterAcl [-VM] <VirtualMachine[]> -Action <VMNetworkAdapterAclAction> {Allow | Deny | Meter} -Direction <VMNetworkAdapterAclDirection> {Inbound | Outbound | Both} [-LocalIPAddress <String[]> ] [-LocalMacAddress <String[]> ] [-Passthru] [-RemoteIPAddress <String[]> ] [-RemoteMacAddress <String[]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細描述
The Remove-VMNetworkAdapterAcl cmdlet removes an ACL applied to the traffic through a virtual network adapter.
參數
-Action<VMNetworkAdapterAclAction>
Specifies the action of the ACL to be removed. Allowed values are Allow, Deny, and Meter.
別名 |
none |
必要項? |
true |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-CimSession<Microsoft.Management.Infrastructure.CimSession[]>
在遠端工作階段或遠端電腦上執行 Cmdlet。輸入電腦名稱或工作階段物件,例如 New-CimSession 或 Get-CimSession Cmdlet 的輸出。預設為本機電腦上目前的工作階段。
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-ComputerName<String[]>
Specifies one or more Hyper-V hosts on which the ACL applied to a virtual machine network adapter is to be removed. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-Credential<System.Management.Automation.PSCredential[]>
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-Direction<VMNetworkAdapterAclDirection>
The direction of the network traffic (from the perspective of the virtual machine) to which the ACL applies. Allowed values are Inbound, Outbound, or Both.
別名 |
none |
必要項? |
true |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-InputObject<VMNetworkAdapterAclSetting[]>
Specifies the ACL to be removed.
別名 |
none |
必要項? |
true |
位置? |
1 |
預設值 |
none |
接受管線輸入? |
True (ByValue, ByPropertyName) |
接受萬用字元? |
false |
-LocalIPAddress<String[]>
Specifies the local IP address. It can be either IPv4 or IPv6 address. It can be either a host address or a subnet address, e.g. 1.2.3.4, 2001::2008, 192.168.1.0/24, or f001:f002:f003:f004::1/64.the IP address can also be a wildcard, 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6 addresses.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-LocalMacAddress<String[]>
Specifies the local MAC address (e.g. 00-ab-00-11-22-33). Use the wildcard ANY to specify all MAC addresses.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-ManagementOS
Specifies that the ACL is to be removed from the management (e.g. the parent, or host) operating system.
別名 |
none |
必要項? |
true |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-Passthru
Specifies that a Microsoft.HyperV.PowerShell.VMNetworkAdapterAclSetting object is to be passed through to the pipeline representing the ACL to be removed.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-RemoteIPAddress<String[]>
Specifies the remote IP address. . It can be either IPv4 or IPv6 address. It can be either a host address or a subnet address, e.g. 1.2.3.4, 2001::2008, 192.168.1.0/24, or f001:f002:f003:f004::1/64. the IP address can also be a wildcard, 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6 addresses.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-RemoteMacAddress<String[]>
Specifies the remote MAC address. . It can be a host MAC address, e.g. 00-ab-00-11-22-33, or a wildcard, ANY, for all MAC addresses.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-VM<VirtualMachine[]>
Specifies the virtual machine from which the ACL is to be removed.
別名 |
none |
必要項? |
true |
位置? |
1 |
預設值 |
none |
接受管線輸入? |
True (ByValue) |
接受萬用字元? |
false |
-VMName<String[]>
Specifies the name of the virtual machine from which the ACL is to be removed.
別名 |
none |
必要項? |
true |
位置? |
1 |
預設值 |
none |
接受管線輸入? |
True (ByValue) |
接受萬用字元? |
false |
-VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual machine network adapter from which ACL is to be removed.
別名 |
none |
必要項? |
true |
位置? |
1 |
預設值 |
none |
接受管線輸入? |
True (ByValue) |
接受萬用字元? |
false |
-VMNetworkAdapterName<String>
Specifies the name of the virtual machine network adapter from which the ACL is to be removed.
別名 |
none |
必要項? |
false |
位置? |
named |
預設值 |
none |
接受管線輸入? |
false |
接受萬用字元? |
false |
-Confirm
在執行指令程式之前提示您確認。
必要項? |
false |
位置? |
named |
預設值 |
false |
接受管線輸入? |
false |
接受萬用字元? |
false |
-WhatIf
示範當執行指令程式時會發生什麼事情。此指令程式並未執行。
必要項? |
false |
位置? |
named |
預設值 |
false |
接受管線輸入? |
false |
接受萬用字元? |
false |
<CommonParameters>
這個指令程式支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。如需詳細資訊,請參閱 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
輸入
輸入類型是可透過管道傳送至指令程式的物件類型。
輸出
輸出類型是指令程式所發出的物件類型。
- None by default, Microsoft.HyperV.PowerShell.VMNetworkAdapterAclSetting if –PassThru is specified.
範例
Example 1
Removes from virtual machine Redmond the ACL allowing any IPv4 traffic sent from or to the virtual machine.
PS C:\> Remove-VMNetworkAdapterAcl -VMName Redmond -RemoteIPAddress 0.0.0.0/0 -Direction Both -Action Allow
Example 2
Removes from virtual machine Redmond the ACL that allows any IPv6 traffic sent from and to the virtual machine.
PS C:\> Remove-VMNetworkAdapterAcl –VMName Redmond -RemoteIPAddress ::/0 -Direction Both -Action Allow
Example 3
Removes the MAC ACL to prevent virtual machine Redmond from sending traffic to or receiving traffic from a remote device with MAC address 03-0f-01-0e-aa-b2.
PS C:\> Remove-VMNetworkAdapterAcl -VMName Redmond -RemoteMacAddress 03-0f-01-0e-aa-b2 -Direction Both -Action Deny
Example 4
Retrieves all the port ACLs configured for virtual machine Redmond and pipelines them to Remove-VMNetworkAdapterAcl, which removes all of them from the virtual machine.
PS C:\> Get-VMNetworkAdapterAcl -VMName Redmond | Remove-VMNetworkAdapterAcl