0

Hi we have 6 Vspher server and my Vcenter is Linux Based and version is Vsphere 5.5 .

We are trying manage our VMware environment automatically via PowerCLI script .

I got a script on internet but getting error . Thanks to Lucd and Kunaludapi for helping.

Need some help on this.

Move-VM : Cannot convert 'System.Object[]' to the type 'VMware.VimAutomation.Vi
Core.Types.V1.Inventory.VIContainer' required by parameter 'Destination'. Speci
fied method is not supported.
At C:\Scheduled tasks\Vmware DRS Script.ps1:103 char:53
+                        $objVM | move-vm -destination <<<<  (get-vmhost $strDe
st);
    + CategoryInfo          : InvalidArgument: (:) [Move-VM], ParameterBinding
   Exception
    + FullyQualifiedErrorId : CannotConvertArgument,VMware.VimAutomation.ViCor
   e.Cmdlets.Commands.MoveVM
Sebastien C.
  • 4,649
  • 1
  • 21
  • 32
user219843
  • 1
  • 1
  • 2

1 Answers1

-1

google is your friend

http://kc-tek.blogspot.co.nz/2012/06/vmotion-vms-from-one-given-host-to.html

As always when using PowerCLI you have to connect to your vCentre server
Connect-VIserver SeverName
Issue the command to 'get' the VMs from the host you want to move them off and then 'move' them to the target host.
Get-VM -Location "HostName" | Move-VM -Destination (Get-Vmhost "NewHost")