VMware Cloud Community
lm31
Contributor
Contributor

Getting all desktops that are assigned to a user

Hi, I'm trying to figure out how to get a list of all desktops that are assigned to a particular user. Something like Get-RemoteSession -username <user> but that only returns something if theres an active session. How can I see if they just have an assigned desktop? Get-DesktopVM doesn't take a username or displayname parameter so I'm not sure how to tackle this.

I am running View 5.2.

Thanks in advance!

0 Kudos
1 Reply
RvdNieuwendijk
Leadership
Leadership

You can filter the output of the Get-DesktopVM cmdlet for the desired information. The following PowerCLI command will retrieve all of the desktops assigned to user 'domain\user':

Get-DesktopVM | Where-Object {$_.user_displayname -eq 'domain\user'}

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos