PowerCLI-Example-Scripts
PowerCLI-Example-Scripts copied to clipboard
Get-machinesummary throwing error and exists script after upgrade to esx 6.7 on Desktop Pools, worked before upgrade.
After upgrading to new ESX version HV helper continues to fail with below error. I have uninstalled all Powershell modules and reinstalled, and also using the latest HV.Vmware .helper module. It still works for some desktop pools, but not for the main ones. One that fails has 300 desktops in it and the other pool around 1100. And to further add to the issue the same HV helper Module works on another connection server in another data center after the upgrade. The pools there are in the same numbers as on the faulty one on the working connection server. And adding a new user In VMware has also been tested and does not work.
Command not working now:
Get-HVMachineSummary -PoolName "DESKTOPPOOL" Get-HVMachine -PoolName "DESKTOPPOOL"
Failure:
Exception calling "QueryService_Create" with "2" argument(s): "ExceptionType : VMware.Hv.EntityNotFound ErrorMessage : Could not find user or group in AD Id : VMware.Hv.UserOrGroupId" At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:7031 char:5 $queryResults = $query_service_helper.QueryService_Create($servic ...
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : VimException
Exception calling "QueryService_Delete" 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:7037 char:5 $query_service_helper.QueryService_Delete($services, $queryResult ...
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : InvalidOperationException
Exception calling "QueryService_Create" with "2" argument(s): "ExceptionType : VMware.Hv.EntityNotFound ErrorMessage : Could not find user or group in AD Id : VMware.Hv.UserOrGroupId" At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:7043 char:5 $queryResults = $query_service_helper.QueryService_Create($servic ...
CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : VimException
Exception calling "QueryService_Delete" 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:7061 char:5
$query_service_helper.QueryService_Delete($services, $queryResult ...
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : InvalidOperationException
Same problem. Current work around iterate over all states and catch exceptions (that gets most of the VMs)
Same problem. Current work around iterate over all states and catch exceptions (that gets most of the VMs)
How to?
Get-HVMachineSummary -machinename evvdi020100 (working fine)... but... Get-HVMachineSummary -machinename evvdi02010* (not working :( )
I experienced this problem and performed a few tests. We have some users that are still assigned to some persistent desktops and are no longer with the company. Therefore these usersids were no longer valid. When I unassigned these user accounts from the VDI, I was able to run the script successfully. It's almost like we need an -IgnoreADCheck switch or something to that regard because in this scenario it will always fail.
Same problem. Current work around iterate over all states and catch exceptions (that gets most of the VMs)
Thanks, this mostly worked for us as well. We noticed machines in the "AVAILABLE" status was not getting populated. We just grabbed all the state options from (Get-command Get-HVMachineSummary).Definition and put them into an array. From there we iterated through each status state as you mentioned. For the states that were not getting populated (i.e. AVAILABLE), I queried for vm's belonging to the end user (via get-adcomputer workflow) and used the Get-HVMachine command to match up the correct pool and get the state status.