Maintaining GUI on Windows Server 2016 when not connected via RDP

Posted on

A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about Maintaining GUI on Windows Server 2016 when not connected via RDP was one problem in server stack that need for a solution. Below are some tips in manage your windows server when you find problem about windows, amazon-ec2, rdp, graphical-user-interface, .

I am running a windows VM on Amazon EC2 which is a 2016 server.

I have a script set up that uses a graphical image search function to find some data. This runs perfectly fine when I am remotely connected, and I have scheduled it to run at 2am, so that I can automatically boot the instance up, have the script run, and then power the instance down without me needing to do anything.

However, the script fails when I am not connected via RDP, because it can’t find the images because the GUI isn’t being rendered.

What I am looking for is a way to have the GUI be rendered when I’m not connected via RDP, and I haven’t been able to find any solutions to this problem online.

To further illustrate the problem, If I log on, and run the script manually via RDP, it starts to work. However, if I close the RDP connection, the script still runs, but doesn’t succeed as it can no longer get image data. I want my script to be able to get image data while there is no active RDP connection.

Edit: this is different from the linked topic as I am trying to use the graphical features of the OS, rather than just running a script automatically.

I would try the following approach:

  1. Configure auto logon

    a. Let the system automaticly login after starting as a specific user with Autologon:
    https://docs.microsoft.com/nl-nl/sysinternals/downloads/autologon

    b. OR set a registry key to perform this task: https://technet.microsoft.com/en-us/library/cc939702.aspx

  2. Configure a scheduled task to run after logon (NOT after startup) which starts the desired script.

This way the script runs in the console session. Monitoring it would be harder (does EC2 has option to view and work in console session?). However you can always install some kind or remote administration tool to view the console session.

Leave a Reply

Your email address will not be published.