- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assign user in Dedicated pool with Powershell
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No way, I tried it from PowerCLI and View PowerCLI as well but without success.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your Screenshot is from Standard PowerCLI 6.5
What das View PowerCLI on the Connection Servers say?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Firstly it fails to load in the snapin and it cannot find cmdlet as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It should look like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe insufficient user rights?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ![]()