VMware Cloud Community
jamie20
Enthusiast
Enthusiast

Get Entitlement issue

Hi guys,

Am trying to get entitlements assigned to specific application(say firefox). But it returns the values in API ID format.

Here is what I did:

$appEntitlements = Get-HVEntitlement -ResourceName 'firefox' -ResourceType application

Write-Host 'App entitlements:';

foreach ($info in $appEntitlements) {

Write-Host $info.id.id;

}

Also,

(Get-HVEntitlement -ResourceName 'firefox').id

(Get-HVEntitlement -ResourceName 'firefox').id.id

both commands returns the same output.

Any help?

0 Kudos
8 Replies
LucD
Leadership
Leadership

Can't you use the Get-HVInternalName cmdlet with that Id?

See Wouter's Finding Horizon View local entitlements using PowerCLI


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jamie20
Enthusiast
Enthusiast

Hi Lucd,

Thanks for the reply.

Yes I referred that link.

Also I replaced write-host with Get-HVInternalName , It gives empty result.

0 Kudos
jamie20
Enthusiast
Enthusiast

Hi LucD,

Help me on this. Am getting the output like below:

How to fix this?

0 Kudos
LucD
Leadership
Leadership

I don't see any output in your reply


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jamie20
Enthusiast
Enthusiast

sample.PNG

Sorry Lucd, I think I should use Insert Image option.

0 Kudos
LucD
Leadership
Leadership

Did you try using the Get-HVInternalName cmlet on those Ids?

See also Wouter's Finding Horizon View local entitlements using PowerCLI post.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jamie20
Enthusiast
Enthusiast

Hi LucD,

I tried Get-HVInternalName cmdlet, but I get empty result.

0 Kudos
jamie20
Enthusiast
Enthusiast

Hi LucD,

Got the output by using base.loginname.

Below is the complete script.

$desEntitlements = Get-HVEntitlement -ResourceName 'desktop-pool-01'

Write-Host 'Desktop entitlements:';

foreach ($info in $desEntitlements) {

write-host $info.base.loginname;

}

Output:

Desktop entitlements:

user01

user02

I could now take entitlements of a single desktop. But dont know how to get entitlements of all the desktop pools to the connected View server.

Expected csv output:

 

Desktop Pool NameEntitlement
desktop-pool-01 user01, user02
desktop-pool-02user01, user03

.

.

.

Any help?

0 Kudos