0

Let’s say I have a Remote Desktop Services environment with two connection brokers and four Remote Desktop Session Hosts.

I want to know which of the four session hosts that user jdoe is logged on to.

How can I retrieve this information using Powershell?

Carl Winbäck
  • 243
  • 3
  • 12

1 Answers1

2

You can use Get-RDUserSession, like that:

Import-Module RemoteDesktop
Get-RDUserSession | where {$_.UserName -eq "jdoe"} | Select HostServer
Swisstone
  • 6,725
  • 7
  • 22
  • 32
  • For those finding this from a Google search, this will need to be run with administrative permissions or it will not work. – HacDan Nov 15 '22 at 16:41