Hi guys,
I need to solve situation where user assigment in Horizon dedicated pool must be automatic. Well, it's not a problem itself, I have one idea in my head where I will use AD groups and task scheduler with powershell script inside. But problem is that I am not able to find any usable cmdlet for assigment operation.
I was searching VMware Docs and there is something about Update-UserOwnership cmdlet that could solve my problem. However, even I imported all modules from PowerCLI to PowerShell I cannot find it there, this cmdlet doesn't exist.
Reference here: Updating Virtual Machine Ownership
I also imported VMware.v.Helper module but I didn't find anything useful, too.
Is there some cmdlet or short script which can help me to solve this fundamental Horizon operation in Powershell?
Thank you.
This cmdlet is unfortunately only available within the PowerCLI on the Connection Servers itself.
Start the PowerCLI there with the Start Menu entry.
Would love to do this remote too.
Best regards
Andreas
No way, I tried it from PowerCLI and View PowerCLI as well but without success.
Your Screenshot is from Standard PowerCLI 6.5
What das View PowerCLI on the Connection Servers say?
Firstly it fails to load in the snapin and it cannot find cmdlet as well.
It should look like this:
Maybe insufficient user rights?
Ahh lol, really run as administrator helped to run it in View PowerCLI but anyway I am still missing possibility to run it remotely from some management server, not especially only on Connectivity servers 😞
What version of horizon and powercli are you using. Looking at your screenshots your trying to load snapins, in the latest versions of powercli those don't work, you need to use modules.
Try adding this at the top instead of add snapin part if you have the latest
Get-Module -Name VMware* -ListAvailable | Import-Module
PowerCLI from PowerShell Gallery does not have this functionality (at least i did not find it :smileycry:).
But you are right, upgrading to latest Version should be mandatory.
Best regards
Andreas
Powercli from the powercli gallery should have it.
PowerShell Gallery | VMware.VimAutomation.HorizonView 7.1.0.5307191
from my understanding everything powercli related now should be installed from the powershell gallery. The problem is the new ones vs the ones from 6.2.1 are alot harder to use. I'd look at
https://blogs.vmware.com/euc/2017/01/vmware-horizon-7-powercli-6-5.html
for information on this.
Yes i agree they are more difficult.
That's why using the local View PowerCLI was comfortable for when i tried this last year.
This Guy has managed this with a new command:
https://www.retouw.nl/powercli/adding-manual-desktops-in-horizon-view-and-assigning-them-using-power...
Great!
that guy is me, what is needed it the vmware.hv.helper module from the powercli example scripts at GitHub - vmware/PowerCLI-Example-Scripts
What you can now do is this:
Set-HVMachine -HvServer $vcs -MachineName machine.fqdn -User "domain\user"
or
Get-HVMachine -MachineName machine.fqdn | Set-HVMachine -User user@domain
thanx to another contributor of the module