问题
Is it me or GUI windows don't show up in the SYSTEM account session?
I don't want to interact with them, but they need to pop up since I have a script that interacts with the windows in an automated way.
I built a script that needs to interact with a software's windows to gather information. This works perfectly when done in a user's session but the problem is that when ran via SCCM and the "system" session (which is what we want since we don't want the user to see it happen), the software starts but it's windows are not generated apparently, therefore the script hangs.
Is it possible to somehow enable interactive windows to appear while it runs in SYSTEM session?
回答1:
Little more insights on session 0.
- Prior to Vista/2008 Server, all services ran in the same session as the first user who logged onto the console - this is Session 0. Well, running user apps and services in this session posed a security risk because services run at elevated privileges and can be targets for malicious code.
- Now only system processes and services now run in Session 0. The first user who logs onto a machine does so in Session 1. Subsequent users log into Session 2, 3, 4, etc. Doing this isolation protects services and system processes from tasks ran in this session.
- Session 0 run's the application in non-interactive way even if application is interactive.
- I noticed same behavior while running my .vbs using task scheduler and when I created windows service for my application.
- Refer below link to understand what are the cases when interactive application gets open in session 0. Example illustrate notepad.exe opened in session 0
Session0 Thing
回答2:
Answer is based on the comments above. The problem is that there are no GUI windows appearing in session-0 (SYSTEM), and it seems to be by design. The program runs but the windows aren't allowed to show apparently. So it's advised to find another way to gather the data if you ever encounter this situation.
来源:https://stackoverflow.com/questions/57326309/interactive-application-running-in-system-session-via-sccm