12 Replies Latest reply on Feb 12, 2018 12:56 PM by Magneet

    Is it possible to programmtically, using 6.5.1 PS and API 7.1, to Reset/Refresh Horizon Desktop in a Problem State using PowerShell using only an HVServer connection

    pegduffy Novice

      I read this article.

      Reset/Refresh Horizon Desktop in a Problem State using PowerShell

      I read the answer here : Various_Scripts/remove_faulty_VDI_desktop.ps1 at master · Magneet/Various_Scripts · GitHub

       

      Is there a way, not to remove of delete the Agent_Unreachable machine but to just try a desktop refresh or the equivalent, without doing a Connect-VIServer, but using only  the HV server connection?

      I have tried many of the API commands of this nature but can not seem to find a way to do this without a VIServer connection.

       

      Is it possible? Has anyone done it? Would you be willing to share a snippet of your code to guide me.

       

      I have been able to get-hvsummary for each Pool, using -State Unreachable.

       

      Basically, my VMware sysadmins believe this is possible and I am tryng to write the code. I have looked at many calls in the API but get message like "You need a connection to VI Server."

       

      I have a script  making a list of machines in an unreachable state...and then 15 minutes later, by writing results to files and reading previous file back in again....if machine is still unreachable 15 minutes later I want to do whatever is equivalent to a Desktop_Refresh. I have machineids etc.

       

      Peg Duffy