$Pool = "dedicated"
$new_pool = "test2"
$vms = Get-HVMachineSummary -PoolName $Pool
$results = @()
foreach($vm in $vms){
$machine = $null
$machine = Get-VM -Name $vm.Base.Name
$properties = @{
UserName = $vm.NamesData.UserName
MachineName = $vm.Base.Name
}
$results += New-Object psobject -Property $properties
}
$results | export-csv -NoTypeInformation -path c:\test1.csv
sleep 5
$list = import-csv "C:\test1.csv"
foreach($col in $list)
{
$um = $col.UserName
$mc = $col.MachineName
Remove-HVMachine -MachineName $mc -DeleteFromDisk:$false -confirm:$false
Add-HVDesktop -PoolName $new_pool -Machines $mc -confirm:$false
Testing has been completed until moving from the old pool to the new pool by executing the above script. However, after referring to Excel for user assignment of virtual machines assigned to the existing pool, we want to automatically assign them to the new pool. Could you please help on this part?