Hi All,
Does anyone know if there is a way to automate moving powered off VMs to a virtual machine folder? I'm performing a manual method of exporting powered off vms to an excel sheet and joining the vms and commands to a listed output. Then running the list of powercli commands in a batch.
PowerCLI
move-vm VM1 -Destination "Powered Off VMs"
Thanks!
Jason
You could do something like this
ForEach-Object -Process {
Move-VM -VM $_ -InventoryLocation 'Powered Off VMs'
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD!
Is there a way to list powered off vms we don't want to move like server or citrix templates?
If you have a rule to select those, then that can be added to the Where-clause condition.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am using Custom Atributtes for this. I have field DeleteOnDate and if it empty I move VM to selected folder and add a new date to custom attribute. If there is a date in the field I don't move it and also if VM is detected as powered On I empty the field.