Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 6개 있습니다.)

윈도우 8 - UI가 있는 프로그램을 Local SYSTEM 권한의 세션 0 데스크톱에서 실행하는 방법

sysinternals의 psexec.exe를 이용하면 보호모드로 프로그램을 실행할 수도 있고,

보호 모드로 응용 프로그램 디버깅하는 방법
; https://www.sysnet.pe.kr/2/0/682

보호 모드로 응용 프로그램 디버깅하는 방법 - 두 번째 이야기
; https://www.sysnet.pe.kr/2/0/683

시스템(Local SYSTEM) 권한으로 실행하는 것도 가능합니다.

SYSTEM 권한으로 UI 프로그램 실행하는 방법
; https://www.sysnet.pe.kr/2/1/1153

위의 글에서는 UI 프로그램을 Local SYSTEM 권한으로 실행하지만 현재 로그인한 사용자 계정과 동일한 데스크톱 화면에서 활성화시킵니다.

혹시, 서비스 계정들이 활성화되는 세션 0 데스크톱에서 응용 프로그램을 보이게 하는 방법은 없을까요? psexec.exe에서 제공되는 옵션으로 실행해 보면,

C:\temp>psexec \\localhost -i 0 calc.exe

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

위와 같이 출력되다가 멈춰(hang)버립니다. 비록 멈춰있기는 하지만, process explorer를 이용해서 보면 세션 0에서 calc.exe가 실행된 것을 확인할 수 있습니다. 단지, 그 calc.exe가 실행을 종료할때까지 psexec.exe는 실행을 대기하기 때문에 멈춘 것처럼 보이는 것입니다.

그렇다면, 실제로 그 세션 0 데스크톱으로 넘어가서 실행된 calc.exe를 볼 수는 없는 걸까요?

이것이 가능하려면 우선 "Interactive Services Detection" 서비스를 시작해 두어야 합니다.

윈도우 8에서 "Interactive Services Detection" 서비스 시작하는 방법
; https://www.sysnet.pe.kr/2/0/1583

이 서비스를 시작해 두고 다시 "psexec \\localhost -i 0 calc.exe" 명령어를 실행하면 이번에는 작업 표시줄에 (UAC 인증 창처럼) 다음과 같은 모양의 아이콘이 깜빡입니다.

isd_taskbar_icon_1.png

What is Interactive Services Detection and Why is it Blinking at Me?
; http://blogs.msdn.com/b/patricka/archive/2010/04/27/what-is-interactive-services-detection-and-why-is-it-blinking-at-me.aspx

이를 선택하면 다음과 같은 대화창이 뜨는데요. (화면은 devenv.exe를 실행했을 때 캡처한 것입니다.)

isd_taskbar_icon_2.png

참고로, 위의 화면에서 "Why does this happen?" 링크를 누르면 다음과 같은 안내가 나옵니다.

Why can't a program display a message on my desktop?

Some devices and programs that are not fully compatible with Windows do not display their messages on your desktop, but might need your permission on other information to complete a task. To access these messages, click the View the message button.

Only one user at a time can view these messages. If another user is already viewing a message, you cannot check the request until after the other user has finished. Windows will notify you again if the request has not been resolved.

Check with the manufacturer of this device or program for more information on how to fix this issue.

If you disable the Interfactive Services Detection service, all future messages for all interactive services will be turned off. This means that you will no longer be able to view these types of messages.


따라서 "View the message"를 누르면 이제 현재 로그인 한 사용자의 데스크톱 화면에서 세션 0이 활성화된 데스크톱으로 화면 전환이 이뤄집니다.

isd_taskbar_icon_3.png

calc.exe가 실행된 것이 보이시죠? 아울러 다시 사용자의 로그온 데스크톱으로 돌아갈 수 있는 "Interactive Services Detection" 대화창도 함께 제공됩니다. ^^ 뭐 그다지 효용성이 없을 것 같지만 ^^ 세션 0 데스크톱 화면을 "눈으로 본다"는 것에 의미가 있다고 할 수 있습니다.




기타 몇 가지 정리해 봅니다. ^^


1. 재진입 불가능할 때

한번 세션 0 데스크톱으로 전환한 다음 다시 로그온 계정의 데스크톱으로 빠져나왔을 때 다시 psexec.exe를 실행시켜 세션 0으로 진입하고 싶어도 작업 표시줄에 전환 아이콘이 깜빡이지 않을 때가 있습니다.

저도 딱히 뾰족한 방법을 찾을 수 없었는데요. 이런 경우에는 재부팅해야 합니다. ^^; (물론, 다시 들어가고 싶지 않다면 그냥 사용하셔도 됩니다.)


2. Wacom BAMBOO 태블릿 사용 불능

세션 0 데스크톱으로 전환 후 다시 로그온 계정의 데스크톱으로 빠져나오면 그때부터 Bamboo 태블릿이 먹통이 됩니다. 태블릿 접속을 분리하고 다시 꽂으면 될 때도 있는데 그래도 마우스 우클릭이 작동하지 않습니다. 암튼, Wacom의 디바이스 드라이버는 마음에 들지 않습니다.


3. 작업 관리자나 탐색기 류의 프로그램은 실행 불능

세션 0 데스크톱으로 전환했을 때 다른 프로그램들을 자유롭게 실행시키기 위해 탐색기나 작업 관리자를 실행시키고 싶을 수도 있는데요. 웬일인지 그 안에서는 실행되지 않습니다. 그 외에 화면 캡처 프로그램인 "Snagit.exe"도 안 되고 "Process explorer" 등의 프로그램이 실행되지 않습니다. (다행히, 윈도우의 SnippingTool.exe는 실행이 되어서 이번 글의 화면 캡처는 할 수 있었습니다.)

만약, taskmgr.exe를 강제로 psexec.exe를 이용해 실행하게 되면 다음과 같은 오류만 떨어질 뿐 역시 실행되지 않습니다.

C:>psexec \\localhost -i 0 taskmgr.exe

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com


taskmgr.exe exited on localhost with error code -2147023728.

에러코드 -2147023728은 "Element not found" 입니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/17/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  [4]  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13532정성태1/17/20242179닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20242067닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/20242042닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
13529정성태1/15/20241922닷넷: 2202. C# - PublishAot의 glibc에 대한 정적 링킹하는 방법
13528정성태1/14/20242062Linux: 68. busybox 컨테이너에서 실행 가능한 C++, Go 프로그램 빌드
13527정성태1/14/20242012오류 유형: 892. Visual Studio - Failed to launch debug adapter. Additional information may be available in the output window.
13526정성태1/14/20242109닷넷: 2201. C# - Facebook 연동 / 사용자 탈퇴 처리 방법
13525정성태1/13/20242065오류 유형: 891. Visual Studio - Web Application을 실행하지 못하는 IISExpress
13524정성태1/12/20242117오류 유형: 890. 한국투자증권 KIS Developers OpenAPI - GW라우팅 중 오류가 발생했습니다.
13523정성태1/12/20241933오류 유형: 889. Visual Studio - error : A project with that name is already opened in the solution.
13522정성태1/11/20242094닷넷: 2200. C# - HttpClient.PostAsJsonAsync 호출 시 "Transfer-Encoding: chunked" 대신 "Content-Length" 헤더 처리
13521정성태1/11/20242154닷넷: 2199. C# - 한국투자증권 KIS Developers OpenAPI의 WebSocket Ping, Pong 처리
13520정성태1/10/20241892오류 유형: 888. C# - Unable to resolve service for type 'Microsoft.Extensions.ObjectPool.ObjectPool`....'
13519정성태1/10/20241985닷넷: 2198. C# - Reflection을 이용한 ClientWebSocket의 Ping 호출파일 다운로드1
13518정성태1/9/20242255닷넷: 2197. C# - ClientWebSocket의 Ping, Pong 처리
13517정성태1/8/20242101스크립트: 63. Python - 공개 패키지를 이용한 위성 이미지 생성 (pystac_client, odc.stac)
13516정성태1/7/20242194닷넷: 2196. IIS - AppPool의 "Disable Overlapped Recycle" 옵션의 부작용
13515정성태1/6/20242473닷넷: 2195. async 메서드 내에서 C# 7의 discard 구문 활용 사례 [1]
13514정성태1/5/20242115개발 환경 구성: 702. IIS - AppPool의 "Disable Overlapped Recycle" 옵션
13513정성태1/5/20242038닷넷: 2194. C# - WebActivatorEx / System.Web의 PreApplicationStartMethod 특성
13512정성태1/4/20242002개발 환경 구성: 701. IIS - w3wp.exe 프로세스의 ASP.NET 런타임을 항상 Warmup 모드로 유지하는 preload Enabled 설정
13511정성태1/4/20242020닷넷: 2193. C# - ASP.NET Web Application + OpenAPI(Swashbuckle) 스펙 제공
13510정성태1/3/20241956닷넷: 2192. C# - 특정 실행 파일이 있는지 확인하는 방법 (Linux)
13509정성태1/3/20241980오류 유형: 887. .NET Core 2 이하의 프로젝트에서 System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.0.
13508정성태1/3/20242029오류 유형: 886. ORA-28000: the account is locked
13507정성태1/2/20242718닷넷: 2191. C# - IPGlobalProperties를 이용해 netstat처럼 사용 중인 Socket 목록 구하는 방법파일 다운로드1
1  2  3  [4]  5  6  7  8  9  10  11  12  13  14  15  ...