Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create get-hvuser and/or create assign-hvmachine #151

Closed
Magneet opened this issue Jan 10, 2018 · 2 comments

Comments

@Magneet
Copy link
Contributor

@Magneet Magneet commented Jan 10, 2018

To entitle a user to a manual machine the advanced option for base.user needs to be set with the base.name value from aduserorgroupsummaryview besides creating the query yourself there's no way to do that now
I have done it manually like this:
$username="username"
$queryService = New-Object VMware.Hv.QueryServiceService
$defn = New-Object VMware.Hv.QueryDefinition
$defn.queryEntityType = 'ADUserOrGroupSummaryView'
$defn.filter = New-Object VMware.Hv.QueryFilterEquals -property @{'memberName'='base.name'; 'value' = $userName}
try {
$userid=($queryService.queryservice_create($Services1, $defn)).results[0].id
}
catch {
throw "Can't find $Username, exiting"
}

and feed that to get-hvmachine -machinename machinename| set-hvmachine -key base.user -Value $userid

this imho should receive an own command for it, also with get-hvuser all entitlements could be shown over desktops and applications for that user

@biacz

This comment has been minimized.

Copy link

@biacz biacz commented Jan 25, 2018

i'd love to see a PR for this

@mtelvers

This comment has been minimized.

Copy link
Contributor

@mtelvers mtelvers commented Feb 3, 2018

Hi Magneet, I've added code to PR #165 to modify 'Set-HVMachine' so you can use it like this:

Set-HVMachine -HvServer $vcs -MachineName machine.fqdn -User "domain\user"

It's not quite what you asked for, but it gets the job done without needing to build your own query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.