vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
753 stars 603 forks source link

Add-HVDesktop Error with Get-VCenterID #443

Closed jahamilt closed 3 years ago

jahamilt commented 3 years ago

VMware PowerCLI 12.2.0 build 17538434 VMWare Horizon 7.13.0 build - 16962788

Trying to automated adding linux virtual desktops in a manual pool called: Browser-Linux and receiving the following error. I have been successful in removing the existing desktops from the pool. It is just adding through powercli. Command used is: Add-HVDesktop -PoolName "Browser-Linux" -Machines 'host01' The pool in question is set as manual.

Get-VcenterID : Multiple Vcenter servers found, please specify the vCenter Name At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:475 char:13

Exception calling "VirtualMachine_List" with "2" argument(s): "There is an error in the XML document." At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:523 char:3

Add-HVDesktop : Failed to get any Virtual Center machines with the given machines parameter At line:1 char:1

I haver reviewed the VMWare.HV.Helper.psm1 file and does see any issues.

jahamilt commented 3 years ago

I found the issue to be with multiple vCenter server connections within Horizon 7 administrator portal settings. We had an issue with the vCenter connection previously and created a duplicate. Removed the duplicate entry and it works properly. Now my script runs perfectly. I can change the status of the Desktop Pools and add machines through a script nicely.