Automation

 View Only
  • 1.  Can't find Horizon API Method

    Posted Aug 27, 2020 07:06 PM

    Looking for the Machine_assignusers() method per :https://vdc-download.vmware.com/vmwb-repository/dcr-public/93e1f7c4-fae6-4e10-b3be-7c73720b4589/2f59c85d-2770-45cd-bd9d-…

    It says it is on the VMware.Hv.Machine object... when I look at the object I don't see that method

    I just updated Connection server to 7.12. Any thoughts?



  • 2.  RE: Can't find Horizon API Method

    Posted Aug 27, 2020 07:55 PM

    ALready send you the link on Slack but check this post: https://www.retouw.nl/2018/01/11/adding-manual-desktops-in-horizon-view-and-assigning-them-using-powercli/

    So technically what you could do when you purely want to use the api is to use the machineservice helper. My lab is down now but it's a nephew of the desktopservice helper that I use in this blog post: https://www.retouw.nl/2019/12/17/horizonapichanging-the-amount-of-desktops-or-rds-hosts-in-a-pool-farm/



  • 3.  RE: Can't find Horizon API Method
    Best Answer

    Posted Aug 27, 2020 08:01 PM

    Hey Magneet,

    Thanks for the quick response, I appreciate it. I had seen that blog, however I am specifically trying to use the method list in the link I posted....A picture I posted in my first post didn't get added....

    Although the blog post you linked to would solve my problem, I was hoping not to use it as it would complicate the script I am trying to write.

    Fortunate, or unfotunately, this was a scenario of as soon as I posted the question and asked for help I immediately solved it.

    It turns out that although I had update the Connection server to the correct version to use the method machine_assignuser().....I hadn't update the PowerCLI module. After I did that update and restarted powercli/powershell it showed up

    Thanks again for your reply. I appreciate it.



  • 4.  RE: Can't find Horizon API Method

    Posted Aug 27, 2020 08:05 PM

    cool, from what I remember the assignusers was kinda bitchy so I didn't use it. You need to force feed the use ID as an array and not a single object.