2

On our server running Windows Server 2008 R2 there is a scheduled task that runs a Windows application (.Net 4.0) under a specific domain user that performs some tasks and reports its progress in a listbox on a form that pops up by double clicking on a tray icon (right hand side of the task bar).

I understand that if I logon to the server (I can only remote desktop to the server) with a different user other than the one the scheduled task runs the application under I would not be able to see any user interface of the application but the problem is even if I remote desktop with the same login as that of the scheduled task I cannot see the tray icon and consequently the application user interface.

I wonder where this limitation comes from and how I could make is possible to see the application UI. Any idea please?

Rez.Net
  • 1,354
  • 2
  • 19
  • 28

2 Answers2

2

Possibly when you remote to the server you are not using the /admin switch which will present the console view (where presumbly your app is running) rather than the "2nd session".

Bob
  • 21
  • 2
0

I don't see that this is a limitation, it's part of the security design of the system.

One common way to handle such a scenario would be as follows:

  • Implement the main task as a service.
  • Implement a small UI program that presents an icon in the notification area (the tray).
  • Communicate between the UI and the service over a named pipe, TCP/IP or some other communication mechanism.

If you do it this way then it is quite possible to run the UI on a different computer which sounds like it might make life easier for you.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Thanks David. Your solution would solve the issue but technically I am not in a situation to split a critical application into two parts to resolve this problem due to the company policy and budgeting. So basically I am looking for the reason/solution to why my app is not showing up even when I login with the same user that the app is running under. – Rez.Net Jan 03 '11 at 23:15
  • @user you might try to allow your service to interact with the desktop using the option in the service control panel. That is a large security hole but perhaps your company's policy would be fine with that. You should read up on session 0 isolation. It also occurs that the interact with desktop option may not be available under the server role. – David Heffernan Jan 03 '11 at 23:20