pply. Please see the Hyper-V Network Virtualization Cookbook for an example of the format used PARAMETER VMList This should contain a list of VMs to applt the rules to. You can pass an array such as @ ("VM 1", "VM 2") or a ; separated list such as "VM 1; VM 2" EXAMPLE Add-MultipleVMNetworkAdapterExtendedAcl -CSVPath \Rules.csv - VMList "Tenant A - VM 12;Tenant A - VM 13" [CmdletBinding () Param # CSVPath is the path to the CSV containing the rules [Parameter (Mandatory=$true, Position=0)] ] [ValidateNotNull ( ) [ValidateNotNull0rEmpty [ValidateScript( #Ensure the CSV file exists Network Access Control Lists Test-Path -Path $ -PathType Leaf [string] $CSVPath, # VMList is the list of VMs to applt the port ACLs to [Parameter (Mandatory=$true, Position=1)] [ValidateNotNull () ] [ValidateNotNullOrEmpty() [string []] $VMList Begin Write-Verbose "Starting process" Write-Verbose "Importing CSV file $CSVPath" #Read in the CSV containing the Port ACL list $PortRules = Import-Csv -Path $CSVPath if ($VMList [0] contains (";") { Write-Verbose "Found at least one ; in the VMList. Changing to an array" $VMList = $VMList.Split (";") Process #Build PowerShell cmdlet to execute against remote server for VM $BaseLine = "Add-VMNetworkAdapterExtendedAcl -Action {0} - Direction {1} -VMName " { { 2 } " " -Weight {3} IsolationID $StatefulBase = " -LocalPort {0} Protocol {1} -Stateful `$True" #Iterate each VM in the list the user has passed Write-Verbose "Iterating through each VM in VMList" ForEach ($VM in $VMList) { #Get the VM from VMM Write-Verbose "Getting information for " $ ($VM.Trim())"" from VMM" Chapter 7 $VmmVm = Get-SCVirtualMachine -Name $VM.Trim() #Check if VMM has found something if (-Not ($VmmVm) ) { Write-Error "$VM cannot be found in VMM" #Move to the next VM in the list continue; #Determine the VM Network VM Subnet ID Write-Verbose "Getting Virtual Subnet ID for ""$($VM.Trim()) $VMSubnetID = (Get-SCVMSubnet -VMNetwork VmmVM.VirtualNetworkAdapters.VMNetwork -Name $VmmVM.VirtualNetworkAdapters.VMSubnet).VMSubnetID Write-