Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a large, specialty printer that has vendor specific software that enables its use outside of it showing up simply as a printer in the Windows Control Panel. This software recognizes when we RDP into the machine and "disconnects" the PC from the printer within its proprietary control panel.

All is well when an application like TeamViewer is used to access the machine.

Ostensibly, the application is helping us be safe by "enforcing" that the machine used for the printer is a walk up workstation, or so the support folks informed me.

If TeamViewer etc, fixes the issue, then what is the problem? We have many headless workstations in our warehouse attached to a variety of specialty machines, all used via RDP. We want/need to keep access to the machines the same for the sanity of our production staff.

The meat of the question - how, specifically, might a machine know that it is being accessed via RDP (terminal services management???) and how might this be defeated without altering an application or driver.

Of note, the system being used is a Windows 7 Pro machine hooked to the printer via USB.

Thanks! Nat


Is there any combination of /admin switches, etc. that will possibly fix this? Simply putting /admin did not.

share|improve this question
Stupid question - have you tried running the printer software as other user with different session than the one that connects trough RDP? – D.Iankov Sep 13 '12 at 21:14
Some applications actually refuse to work over RDP because it's against their licensing policy. – jjlin Sep 13 '12 at 22:15
I don't understand the question. TeamViewer technically is not RDP software which is the reason it doesn't cause the software to disconnect. As you are nto asking HOW to keep the printer from disconnecting when using RDP? I can't figure out what your are asking. Its simple enough to determine if a computer is being connected through RDP by looking at various details unique to RDP. Ask the vendor to help you disable this feature. – Ramhound Sep 14 '12 at 12:04
up vote 2 down vote accepted

how, specifically, might a machine know that it is being accessed via RDP?

The machine does not care. The software can know using:

  • GetSystemMetrics(SM_REMOTESESSION) – can supposedly be fooled with /admin or /console;

  • WTSQuerySessionInformation(WTS_CURRENT_SESSION) and checking the session name (WTSWinStationName) if it's console or rdp-tcp#<n> – it is possible to rename sessions using an undocumented wtsapi32.dll function;

  • WTSQuerySessionInformation(WTS_CURRENT_SESSION) and checking the protocol (WTSClientProtocolType) if it's wdcon or rdpwd – this cannot be changed at all.

TeamViewer and VNC work because it does not use Terminal Services, only connects into the same session the user is on.

Another possible cause is "printer redirection" in Remote Desktop, which can be disabled in the client under "Local Resources".

share|improve this answer
Thanks - you are right, I was asking about how the special tray tools would know (ie, the software) that were were coming in via RDP. We'll take a look at implementing suggestion #2 and see if that resolves the issue.. We did try clearing out printer redirection and using the admin switch without success before which seem to be the "easy" answers. I am aware that Teamviewer, VNC, etc. are fundamentally different than RDP :) Thanks again! – blckgrffn Sep 17 '12 at 13:03
@blckgrffn: As far as I remember, the function is WinStationRenameW(HANDLE hServer = WTS_CURRENT_SERVER_HANDLE, LPWSTR *oldName, LPWSTR *newName) in the winsta.dll library, and requires SeTcbPrivilege. I only tested it on WinXP. – grawity Sep 17 '12 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .