1

Two years ago, I was working in a dreadful company. There, all my colleagues were using RDP connections and in order to know if a connection was available, I needed to ask them. So I have asked this question about the subject.

Now I'm working in a far better company, but I have a similar question: now it's not about my colleagues, who might be using the connection, but customers, and I try to use the accepted answer on that question in order to find out, but the result is not very useful:

Command prompt>query user /server:87.84.6.67
Error 0x000006BA enumerating sessionnames
Error [1722]:The RPC server is unavailable.

I get this error message, although, when I try to connect to the machine, this works for several seconds (and then then I get kicked out, at least that's the impression I have).

Does anybody know what to do?

Oh, my command prompt seems to run as administrator by default, I don't know if this makes any difference.

I just tried quser and qwinsta as user1686 suggested, but both give me the same answer. I don't know the sense of using winrs, it looks to me as a remote shell command, but I don't want to log to the machine and ask a question there, I just want to know who is using the RDP session.

Dominique
  • 2,373

1 Answers1

2

The answer hasn't changed since then; the answer still is "use qwinsta or quser to list Terminal Services users".

Note that qwinsta/quser use DCOM RPC, which has its own firewall rules separate from RDP. There is no way to get the same information through the RDP protocol alone.

If RPC access is blocked (which it most likely is), find some other way to run the commands, e.g. through WinRM (winrs or Invoke-Command) or through SSH (if the server has SSH installed) or through some other remote management system.

If RPC is firewalled because you're accessing the server over WAN, ask the server owner to set up some form of VPN access so that you'd be able to connect to the server in other ways than RDP. For example, having WinRM or SSH access is very useful, both for your question and for remote access in general – you might be able to do all your work without RDP, and therefore without disturbing whoever else is RDP'd in.

Finally, ask your employer to reserve a time when the server would not be managed by anyone else, so that you could just RDP in and do your work. If they expect you to be accessing the server, it's their job to ensure that access.

grawity
  • 501,077