Software disables itself when the PC is accessed via RDP

5

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

edit

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

blckgrffn

Posted 2012-09-13T21:08:31.510

Reputation: 53

1Stupid question - have you tried running the printer software as other user with different session than the one that connects trough RDP? – D.Iankov – 2012-09-13T21:14:20.467

1Some applications actually refuse to work over RDP because it's against their licensing policy. – jjlin – 2012-09-13T22:15:18.247

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 – 2012-09-14T12:04:02.523

Answers

2

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".

user1686

Posted 2012-09-13T21:08:31.510

Reputation: 283 655

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 – 2012-09-17T13:03:58.333

@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. – user1686 – 2012-09-17T14:28:24.173