Configures Hyper-V firewall per-VM settings on the target computer.
Networking / Security · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft NetSecurity reference: Configures Hyper-V firewall per-VM settings on the target computer. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for New-NetFirewallHyperVVMSetting. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / NetSecurity · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-AllowHostPolicyMerge
Specifies that the host firewall policy should be merged into the effective policy. This setting controls whether host firewall profile settings (DefaultInboundAction, DefaultOutboundAction, Enabled, AllowLocalFirewallRules) as well as host firewall rules (only rules that are IP 5-tuple based, that is, not having any local conditions such as application) should be applicable to Hyper-V firewall. Policy configurations may come from many stores. If this setting is True, the following order of precedence is used for determining the effective policy (highest priority to lowest priority): - Host Firewall Group Policy - Hyper-V Firewall MDM - Host Firewall MDM - Hyper-V Firewall Local - Host Firewall Local The acceptable values for this parameter are: False, True, or NotConfigured. - True: Host firewall rules and settings are applied to the Hyper-V firewall. - False: Host firewall rules and settings are not applied to Hyper-V firewall - NotConfigured: Resets this value back to its default. The default setting is True.
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
-DefaultInboundAction
Specifies how to filter inbound traffic which does not match any Hyper-V firewall rules. The acceptable values for this parameter are: NotConfigured, Allow, or Block. This setting applies the configuration to all profiles. For configuring at a per-profile granularity, use the New-NetFirewallHyperVProfile cmdlet. - Block: Blocks inbound network traffic that does not match an inbound rule. - Allow: Allows all inbound network traffic, whether or not it matches an inbound rule. - NotConfigured: Resets this value back to its default. The default setting is Block.
-DefaultOutboundAction
Specifies how to filter outbound traffic which does not match any Hyper-V firewall rules. The acceptable values for this parameter are: NotConfigured, Allow, or Block. This setting applies the configuration to all profiles. For configuring at a per-profile granularity, use the New-NetFirewallHyperVProfile cmdlet. - Block: Blocks outbound network traffic that does not match an outbound rule. - Allow: Allows all outbound network traffic, whether or not it matches an outbound rule. - NotConfigured: Resets this value back to its default. The default setting is Block.
-Enabled
Determines whether or not the Hyper-V firewall is active and enforced. The acceptable values for this parameter are: False, True, or NotConfigured. This setting applies the configuration to all profiles. For configuring at a per-profile granularity, use the New-NetFirewallHyperVProfile cmdlet. - True: Enables Windows Hyper-V firewall. - False: Disables Windows Hyper-V firewall. - NotConfigured: Resets this value back to its default. The default setting is True.
-LoopbackEnabled
Determines whether or not guest-host loopback traffic is allowed. The acceptable values for this parameter are: False, True, or NotConfigured. - True: Hyper-V firewall allows traffic between guest and host. - False: Hyper-V firewall blocks traffic between guest and host. - NotConfigured: Resets this value back to its default. The default setting is False.
-Name
Specifies that the settings are applicable only to the Hyper-V firewall VM creator with the matching ID. The format for this value is a GUID enclosed in brackets: '{9E288F02-CE00-4D9E-BE2B-14CE463B0298}'.
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, Windows PowerShell calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Prerequisites
Windows with the NetSecurity module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
This example configures the LoopbackEnabled setting for all Hyper-V firewall ports created by the Hyper-V firewall VM creator specified. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.