PowerCLI move Multiple VM’s to a VM Folder

$DestinationVC = R0;.wardvissers.nl”

Connect-VIServer $DestinationVC

#Optie 1

$vmfolder = R0;Applicatie Servers”

$tempvms = Get-VM | where {$_.Folder -match ‘vm’}

foreach ($tempvm in $tempvms){

$DestinationHost = Get-VM $tempvm | Get-VMhost

Move-VM -VM $tempvm -InventoryLocation $vmfolder -Destination $DestinationHost -ErrorAction Stop

}

#Optie

# Get-VM | where {$_.Folder -match ‘vm’} | Move-VM -InventoryLocation R0;Diverse Applicatie Servers”

Translate »
%d bloggers like this: