7

I have a rather specialized application that HAS to work in a certain way. It works as a client application on a server. That means I have to be logged on for it to run. At the same time, I cannot keep an RDP connection open at all times, so I have to disconnect after a while.

The application runs fine while I'm disconnected (I only disconnect, I do not log off). However, part of what the application does is that it takes a screenshot of the server. The screenshot comes out fine while I'm logged on, but once I disconnect it comes out black.

Is there some setting in Windows I can change to allow it to take screenshots while I'm disconnected?

Please note: I cannot change the software or the circumstances, only Windows settings.

Update: I actually have a solution, I just don't want to use it because it entails security risks. Using the command "control userpasswords2" I can allow a certain user to be logged on automatically when the server starts. This works well, but it is amazingly insecure so I am hoping not to have to resort to this.

Niels Brinch
  • 413
  • 5
  • 16
  • 1
    Don't you mean "Is there some setting in Windows I can change to allow it to take screenshots while I'm disconnected" ? If you're logged off, the application would be terminated. – jscott Feb 25 '13 at 18:40
  • 1
    Log into the console session instead of an RDP session and leave it running then?? – TheCleaner Feb 25 '13 at 18:43
  • jscott, you're right, I got confused. I corrected the question now. TheCleaner, I will try that. – Niels Brinch Feb 25 '13 at 19:16
  • @TheCleaner I tried logging on with -console and then disconnecting, the result is the same. Screenshots are black. – Niels Brinch Feb 25 '13 at 19:21
  • Sorry, I mean literally at the console (physically at server). Any RDP connection that gets disconnected would cause Windows to stop drawing the session until reconnection. You'll need to physically log in at the server and let the app run. – TheCleaner Feb 25 '13 at 19:24
  • I cannot do that, sorry. This sentence "Any RDP connection that gets disconnected would cause Windows to stop drawing the session until reconnection". Are you sure about this? In that case, that owuld answer my question. The answer is "No". But I am hoping for a workaround. – Niels Brinch Feb 25 '13 at 19:26
  • It might be connected with [Seesion 0 Insolation](http://msdn.microsoft.com/en-us/library/bb756986.aspx). There some tests specified to make sure whether your application would work. But I don't have any verified solution. – Peter Ivan Feb 25 '13 at 22:22

1 Answers1

6

RDP sessions have a black screensaver. If you take a screenshot while a screensaver is up, that is all you will see. Disable the screensaver, so it doesn't come up on the disconnected sessions.

In gpedit.msc: User Configuration -> Administrative Templates -> Control Panel -> Display

Edit: apparently this screensaver only applies if the session is still connected. @TheCleaner is right disconnected session aren't drawn.

From this old answer about rdp console: How to keep user logged-in when disconnecting from RDP session

You can redirect a logged in session to console. It will stay active, but you'll need to redirect it back to rdp when you want to reconnect. Just tried this and it showed the 'console' session as active even when rdp was disconnected.

To redirect to console:

tscon <session#> /dest:console

Then when you want to reconnect to it:

tscon <session#> /dest:<rdp-tcp#>

Initially:

  • Login via rdp initially to create the session and start the application.

  • Redirect the session # to console. Let it run for intended duration.

To reconnect:

  • Login via rdp to create a new session

  • Redirect the console session to the new rdp session

Ryan
  • 912
  • 6
  • 12
  • 1
    +1 - Didn't know about the RDP sessions screensaver. Learn something new everyday – JamesBarnett Feb 25 '13 at 19:32
  • 1
    I disabled **Screen Saver** and **Screen Saver timeout** and tried again. It didn't work. I also tried logging off and on and it still didn't work. The screenshot becomes black as soon as I disconnect from the RDP session. (the application still works otherwise) – Niels Brinch Feb 25 '13 at 19:40
  • It appears that thecleaner was right. Disconnected rdp session aren't drawn at all. Even minimizing them would cause trouble. Using /dest:console as a placeholder, or an alternative remote access tool like VNC are the only workarounds. – Ryan Feb 25 '13 at 20:23
  • Win2k8 doesn't have a console session. – Simon Catlin Feb 25 '13 at 20:25
  • It works! Thankyou so much! One minor detail: The resolution is apparently way WAAY low when the console has the session. Any hints on keeping a higher resolution? – Niels Brinch Feb 25 '13 at 20:48
  • @ Simon Although you can't log into it via the usual mstsc switch, you can still see it there when you run `query session`. – Ryan Feb 25 '13 at 20:55
  • @NielsBrinch Sorry I don't know that one. Probably would try connecting a monitor locally and setting the resolution from a local session. See if it carries over to the console session. Alternatively I'd look for a registry setting that controlled that behavior. Since I do not have something that takes screenshots while I'm disconnected, I'd have to start with determining a way to test. – Ryan Feb 25 '13 at 21:35
  • OK. Thanks again for the solution though. – Niels Brinch Feb 25 '13 at 21:41