If you want to connect to more than one virtual center at the same time, here the starting code :
$vcs = @()
$vcs += connect-viserver "vc 1"
$vcs += connect-viserver "vc 2"
# You could add many as you need...
# Command example : Snapshot all VMs across all VirtualCenter servers.
get-vm -server $vcs | new-snapshot
Note:-
Be careful, the command GET-VM $VCS will not return the same values than GET-VM.
If you use GET-VM, you will receive the VM List only for the Virtual Center that you connect last. If you want the get all the VM of your different virtual centers, you absolutely need to add the parameter -server $vcs to you command. In a general way, don’t forget to add -server $vcs to every command than you use with the VI Toolkit.
No comments:
Post a Comment