Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

권한 상승 전/후 따로 관리되는 공유 네트워크 드라이브 정보

다음과 같은 질문이 있군요.

커맨트 창과 API로 파워쉘 결과가 달라요.
; https://forum.dotnetdev.kr/t/api/8232/3

질문자가, 화면 캡처까지 해서 정보를 올렸기 때문에 쉽게 답이 나올 수 있는 상황이었습니다. ^^ (이처럼, 질문할 때는 가능한 많은 문맥 정보를 공유하시면 답을 얻을 수 있는 확률이 높아집니다.)

이것을 간단하게 재현해 볼까요? ^^ 우선, 일반 사용자 권한으로 Command Prompt를 띄운 후, 네트워크 드라이브를 하나 매핑시켜 둡니다.

C:\temp> net use K: \\testpc\mytemp
The command completed successfully.

C:\temp> net use
New connections will be remembered.

Status       Local     Remote                    Network

-------------------------------------------------------------------------------
OK           K:        \\testpc\mytemp           Microsoft Windows Network
The command completed successfully.

그다음, 해당 창에서 그대로 PowerShell로 전환해 확인하면 동일하게 매핑 정보가 있습니다.

C:\temp> powershell

PS C:\temp> Get-PSDrive

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
Alias                                  Alias
C                 488.70        364.43 FileSystem    C:\                                 ...
K                 103.52         15.88 FileSystem    \\testpc\mytemp
...[생략]...

이 상태에서 "관리자 권한"의 Command Prompt를 띄워서 확인해 보면 아무런 공유 정보가 없습니다.

C:\Windows\System32> net use
New connections will be remembered.

There are no entries in the list.

당연히, "관리자 권한"의 PowerShell로 전환해도 역시 공유 정보가 없습니다.

PS C:\Windows\System32> Get-PSDrive

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
Alias                                  Alias
C                 488.70        364.42 FileSystem    C:\
...[생략]...

참고로, 이에 대해서는 예전에도 한 번 아래의 글에서 언급한 적이 있습니다. ^^

네트워크 공유 폴더(net use)에 대한 인증 정보는 언제까지 유효할까요?
; https://www.sysnet.pe.kr/2/0/11866#runas

이뿐만 아니라, 같은 계정이어도 관리자 권한으로 승격한 전/후에 대해 UAC는 "filtered standard user access token", "full access token" 2가지 유형으로 관리를 하기 때문에 특권(Privileges)도 달라진다는 점도 기억해 두시고. ^^




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







[최초 등록일: ]
[최종 수정일: 9/12/2023]

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

비밀번호

댓글 작성자
 




... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
11892정성태5/10/201912534웹: 38. HTTP Cookie의 expires 시간 형식(RFC7231)
11891정성태5/9/201915009.NET Framework: 831. (번역글) .NET Internals Cookbook Part 12 - Memory structure, attributes, handles
11890정성태5/8/201910775개발 환경 구성: 439. "Visual Studio Enterprise is required to execute the test." 메시지와 관련된 코드 기록
11889정성태5/8/201911624개발 환경 구성: 438. mstest, QTAgent의 로그 파일 설정 방법
11888정성태5/8/201926804.NET Framework: 830. C# - 비동기 호출을 취소하는 CancellationToken의 간단한 예제 코드 [1]파일 다운로드1
11887정성태5/8/201913319.NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건
11886정성태5/7/201912401오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2]
11885정성태5/7/20199378오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생
11884정성태5/5/201913054.NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기
11883정성태5/3/201917362.NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법파일 다운로드1
11882정성태5/2/201914281.NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles파일 다운로드1
11881정성태4/28/201914520오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생
11880정성태4/25/201911219오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547
11879정성태4/24/201916462.NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others파일 다운로드2
11878정성태4/22/201914470.NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff파일 다운로드1
11877정성태4/22/201914418.NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas파일 다운로드1
11876정성태4/21/201914252.NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others파일 다운로드1
11875정성태4/21/201914614오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생
11874정성태4/20/201914625.NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals파일 다운로드1
11873정성태4/19/201913584.NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers파일 다운로드1
11872정성태4/17/201914046.NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members파일 다운로드1
11871정성태4/16/201913905.NET Framework: 818. (번역글) .NET Internals Cookbook Part 3 - Initialization tricks [3]파일 다운로드1
11870정성태4/16/201911574.NET Framework: 817. Process.Start로 실행한 콘솔 프로그램의 출력 결과를 얻는 방법파일 다운로드1
11869정성태4/15/201915421.NET Framework: 816. (번역글) .NET Internals Cookbook Part 2 - GC-related things [2]파일 다운로드2
11868정성태4/15/201913147.NET Framework: 815. CER(Constrained Execution Region)이란?파일 다운로드1
11867정성태4/15/201912175.NET Framework: 814. Critical Finalizer와 SafeHandle의 사용 의미파일 다운로드1
... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...