The Set-VMNetworkAdapterIsolation cmdlet modifies isolation settings for a virtual network adapter.
You can isolate a virtual machine adapter by using virtual local area network (VLAN), Hyper-V Network Virtualization or a third party virtualization solution.
You can specify the isolation method and modify other settings, which include multitenancy settings.
For more information about multitenancy, see the Add-VMNetworkAdapterRoutingDomainMapping cmdlet.
Examples
Example 1: Set isolation mode for a virtual machine
This command sets the isolation mode of the virtual machine named TSQA01 to NativeVirtualSubnet, which indicates Hyper-V Network Virtualization.
The virtual machine does not accept untagged traffic, but the MultitenantStack parameter has a value of On, so the virtual machine can provide services to multiple tenants.
Example 2: Set isolation mode and untagged traffic setting for a virtual machine
This command sets the isolation mode for virtual machine named TSQA01 to be VLAN.
The virtual machine accepts untagged traffic, which is sent and received on VLAN 1, specified by the DefaultIsolationID parameter.
Untagged traffic goes to the default compartment in the virtual machine.
Multitenancy is enabled, therefore, the virtual machine receives isolation subnet and routing domain information.
Parameters
-AllowUntaggedTraffic
Indicates whether the virtual machine sends and receives untagged traffic.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-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.
Parameter properties
Type:
CimSession[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ManagementOS
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ComputerName
Specifies an array of Hyper-V hosts.
The cmdlet modifies isolation settings for virtual machines hosted by the computers that you specify.
Parameter properties
Type:
String[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ManagementOS
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Credential
Specifies one or more user accounts that have permission to perform this action.
The default is the current user.
Parameter properties
Type:
PSCredential[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ManagementOS
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DefaultIsolationID
Specifies the ID of the network for traffic to the default compartment on virtual machines that have multitenancy enabled.
The value that you specify applies only to untagged traffic.
This parameter has an effect only if you specify a value of $True for the AllowUntaggedTraffic parameter.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-IsolationMode
Specifies the isolation mode for the adapter.
The acceptable values for this parameter are:
ExternalVirtualSubnet.
A third party network virtualization solution.
VLAN.
None.
If you specify a value of None, the network adapter uses its default isolation mode.
Set the default isolation mode by using the Set-VMNetworkAdapterVlan cmdlet or the Set-VMNetworkAdapter cmdlet.
Indicates that the cmdlet operates on the parent or host operating system.
If you specify this parameter, this cmdlet modifies isolation settings for the parent or host operating system.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ManagementOS
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MultiTenantStack
Specifies whether to use multiple isolation IDs for the virtual machine.
The acceptable values for this parameter are:
On.
Indicate isolation IDs so that the virtual machine provides services to multiple tenants on different isolation subnets.
Off.
Do not indicate isolation IDs to virtual machine.
Parameter properties
Type:
OnOffState
Default value:
None
Accepted values:
On, Off
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Passthru
Returns an object representing the item with which you are working.
By default, this cmdlet does not generate any output.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VM
Specifies an array of virtual machine objects.
The cmdlet modifies isolation settings for adapters that belong to the virtual machines that you specify.
To obtain a virtual machine object, use the Get-VM cmdlet.
Parameter properties
Type:
VirtualMachine[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMObject
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMName
Specifies an array of names of virtual machines.
The cmdlet modifies isolation settings for adapters that belong to the virtual machines that you specify.
Parameter properties
Type:
String[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMName
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMNetworkAdapter
Specifies an array VM network adapters as VMNetworkAdapterBase objects.
The cmdlet modifies isolation settings for the adapters that you specify.
To obtain a network adapter, use the Get-VMNetworkAdapter cmdlet.
Parameter properties
Type:
VMNetworkAdapterBase[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ResourceObject
Position:
0
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-VMNetworkAdapterName
Specifies the name of a virtual network adapter.
The cmdlet modifies isolation settings for the adapters that you specify.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
VMName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ManagementOS
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
VMObject
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.