Wednesday, 7 September 2011

Windows Server 2008, interact with session 0 UI (net start ui0detect)

net stop ui0detect
net start ui0detect


In Windows Server 2003, you can connect to console session of the server by 'mstsc.exe /console', but this has been deprecated in Windows Server 2008. So, what happens if you have some Windows services which sometimes prompt up dialogue at the console session? If you’re new to Windows Server 2008 and coming from 2003, you might stuck for a while thinking how you can get to those dialogue, worry not, it has a built-in capability which enables you to view and to interact with the session 0 UI from your session.

if the service that is associated with an application tries to display UI elements in session 0, a built-in capability in Windows Server 2008, Windows Server 2008 R2 and in Windows Vista enables you to view and to interact with the session 0 UI from your session”.

Let’s get straight to our scenario.

One of our client is using Dynamics AX2009, although AX2009 runs batch within AOS, but there’re certain batch job won’t works that way. Eg. A batch job which instantiate Excel file, read and write to it.
It has to be run using the legacy batch framework. We use FireDaemon to setup AX client to run as a Windows service. In Windows Server 2003, the AX client will start up at session 0, if you need to interact with this AX client, you can connect to it through 'mstsc.exe /console'. But the session 0 has been made non-interactive in Windows Server 2008 and the AX client runs in that session, so how do we connect to it when we need to look at the AX client?

This is what we do:
1. Logon to the server
2. Run this command in command prompt
    (you’ll need to start the command prompt in elevated mode – right click, Run as administrator)

    IF “Interactive Services Detection” is disabled
    (enable and start it)
   - sc config UI0Detect start= auto
   - net start ui0detect

    IF “Interactive Services Detection” is enabled/manual
    (restart it)
   - net stop ui0detect
   - net start ui0detect

What it actually do is to start the UI0Detect service and prompt the user if there's a dialogue in session 0. The prompt allow user to switch from current session into the "special desktop" of the session 0 which only has interaction with the application who trigger the dialogue.

"Interactive Services Detection", this is the "UI0Detect.exe"

Running the "net stop ui0detect" and "net start ui0detect" will prompt up a window allowing you to switch to the session 0 UI. Click on the "Show me the message"

When you're done, just click on "Return now" to return to your normal desktop

Example of the UI in session 0. In this session, you only see that application itself, there won't be any Start menu, taskbar, & etc.

More references at:

No comments:

Post a Comment