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

비밀번호

댓글 작성자
 




... 16  17  18  19  20  21  22  23  24  [25]  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13011정성태3/21/20226913오류 유형: 802. 윈도우 운영체제에서 웹캠 카메라 인식이 안 되는 경우
13010정성태3/21/20225831오류 유형: 801. Oracle.ManagedDataAccess.Core - GetTypes 호출 시 "Could not load file or assembly 'System.DirectoryServices.Protocols...'" 오류
13009정성태3/20/20227474개발 환경 구성: 640. docker - ibmcom/db2 컨테이너 실행
13008정성태3/19/20226759VS.NET IDE: 176. 비주얼 스튜디오 - 솔루션 탐색기에서 프로젝트를 선택할 때 csproj 파일이 열리지 않도록 만드는 방법
13007정성태3/18/20226332.NET Framework: 1181. C# - Oracle.ManagedDataAccess의 Pool 및 그것의 연결 개체 수를 알아내는 방법파일 다운로드1
13006정성태3/17/20227440.NET Framework: 1180. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 remuxing.c 예제 포팅
13005정성태3/17/20226241오류 유형: 800. C# - System.InvalidOperationException: Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.
13004정성태3/16/20226228디버깅 기술: 182. windbg - 닷넷 메모리 덤프에서 AppDomain에 걸친 정적(static) 필드 값을 조사하는 방법
13003정성태3/15/20226391.NET Framework: 1179. C# - (.NET Framework를 위한) Oracle.ManagedDataAccess 패키지의 성능 카운터 설정 방법
13002정성태3/14/20227183.NET Framework: 1178. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 http_multiclient.c 예제 포팅
13001정성태3/13/20227536.NET Framework: 1177. C# - 닷넷에서 허용하는 메서드의 매개변수와 호출 인자의 최대 수
13000정성태3/12/20227141.NET Framework: 1176. C# - Oracle.ManagedDataAccess.Core의 성능 카운터 설정 방법
12999정성태3/10/20226644.NET Framework: 1175. Visual Studio - 프로젝트 또는 솔루션의 Clean 작업 시 응용 프로그램에서 생성한 파일을 함께 삭제파일 다운로드1
12998정성태3/10/20226204.NET Framework: 1174. C# - ELEMENT_TYPE_FNPTR 유형의 사용 예
12997정성태3/10/202210658오류 유형: 799. Oracle.ManagedDataAccess - "ORA-01882: timezone region not found" 오류가 발생하는 이유
12996정성태3/9/202215731VS.NET IDE: 175. Visual Studio - 인텔리센스에서 오버로드 메서드를 키보드로 선택하는 방법
12995정성태3/8/20228098.NET Framework: 1173. .NET에서 Producer/Consumer를 구현한 BlockingCollection<T>
12994정성태3/8/20227351오류 유형: 798. WinDbg - Failed to load data access module, 0x80004002
12993정성태3/4/20227168.NET Framework: 1172. .NET에서 Producer/Consumer를 구현하는 기초 인터페이스 - IProducerConsumerCollection<T>
12992정성태3/3/20228635.NET Framework: 1171. C# - BouncyCastle을 사용한 암호화/복호화 예제파일 다운로드1
12991정성태3/2/20227784.NET Framework: 1170. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 transcode_aac.c 예제 포팅
12990정성태3/2/20227470오류 유형: 797. msbuild - The BaseOutputPath/OutputPath property is not set for project '[...].vcxproj'
12989정성태3/2/20226958오류 유형: 796. mstest.exe - System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.Tips.WebLoadTest.Tip
12988정성태3/2/20225933오류 유형: 795. CI 환경에서 Docker build 시 csproj의 Link 파일에 대한 빌드 오류
12987정성태3/1/20227439.NET Framework: 1169. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 demuxing_decoding.c 예제 포팅
12986정성태2/28/20228239.NET Framework: 1168. C# -IIncrementalGenerator를 적용한 Version 2 Source Generator 실습 [1]
... 16  17  18  19  20  21  22  23  24  [25]  26  27  28  29  30  ...