Thanks for clearly defining your security requirement. The distinction between a VM that has no network adapter after provisioning and one that has never had a virtual network adapter since initial registration is important.
Based on Microsoft's published Hyper-V documentation, I can confirm the default behavior of New-VM, but I couldn't find a documented guarantee covering the complete VM creation and registration lifecycle you're asking about.
1. Creating a Generation 2 VM without network adapters
Hyper-V automatically creates one virtual network adapter, even when no virtual switch is specified.
Therefore, omitting -SwitchName doesn't satisfy your requirement. It creates a VM with an unconnected network adapter, not one with zero adapters.
The cmdlet also doesn't expose a documented parameter to suppress creating the initial network adapter.
2. Importing a VM with zero network adapters
Your proposed Import-VM -Copy -GenerateNewId approach is worth distinguishing from creating a new VM using New-VM.
Import-VM imports an existing VM configuration, and -GenerateNewId assigns a new unique VM identifier.
However, it doesn't guarantee that importing a configuration containing zero network adapters will preserve that absence throughout the entire registration process without temporarily creating an adapter.
Therefore, while the approach may be technically feasible, I don't describe it as meeting your security requirement without additional Microsoft confirmation.
3. Using WMI/CIM DefineSystem
Msvm_VirtualSystemManagementService.DefineSystem is a method for defining virtual systems through the Hyper-V management interface.
However, it's not a guarantee that using this method without network adapter resource settings ensures no adapter is created at any intermediate point during VM registration.
The existence of the management API alone doesn't establish the required security semantics.
4. Independently verifying initial creation
Get-VMNetworkAdapter is used for inspecting a VM's currently configured virtual network adapters.
For example:
$VMName = "IsolatedGen2VM"
$adapters = @(Get-VMNetworkAdapter -VMName $VMName)
if ($adapters.Count -eq 0) {
Write-Output "No virtual network adapters are currently configured."
}
else {
Write-Output "Virtual network adapters found: $($adapters.Count)"
$adapters | Format-Table Name, SwitchName, MacAddress
}
This can verify the configuration after registration, but it cannot independently prove that no adapter existed during the creation process.
Conclusion
For your specific requirement, distinguish the following:
- Zero adapters in the current configuration: Can be verified using supported Hyper-V management tools.
- Zero adapters throughout initial creation and registration: Microsoft documentation does not guarantee this.
- Independent attestation of that creation-time property: No documented supported mechanism identified.
I don't recommend relying on adapter removal, disconnected virtual switches, or post-creation checks as equivalent security controls, since you've explicitly excluded those approaches.
If this is a mandatory security requirement, I recommend requesting written clarification from Microsoft Hyper-V engineering on the initial hardware-configuration semantics of Import-VM and DefineSystem.
Hope this helps clarify what Hyper-V currently documents and where further confirmation is required
References:
Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.