Get-HVEntitlement shows users and groups when specifying -Type User
Trying to separately get lists of users or groups entitled to certain applications.
Running the following command lists Active Directory groups entitled to MyAppID:
(Get-HVEntitlement -ResourceName "MyAppID" -ResourceType Application -Type Group).base.name
Running the following command shows both Active Directory users and groups, but should only show users unless I've misunderstood the command:
(Get-HVEntitlement -ResourceName "MyAppID" -ResourceType Application -Type User).base.name
Anybody else see this?
On my own system I was able to resolve this editing the Get-HVEntitlement function the following ways:
- In the Parameters section, replace
$Type = 'User',with$Type, - In the Process section, replace
if ($type -eq 'group'){withif ($type){
With these changes in place the behavior is the following:
If -Type is not specified, show both user and group entitlements
If -Type User is specified, show user entitlements only
If -Type Group is specified, show group entitlements only
Hope this helps