2010-04-22 4 views
0

.NET에서 WMI를 사용하여 웹 응용 프로그램의 원격 컴퓨터에 연결하고 있습니다. 연결을 초기화 할 때 Management ConnectionOptions는 항상 텍스트에 사용자 이름과 암호를 요구합니다. 현재 Windows 사용자의 컨텍스트 (예 : page.user.identity)를 사용하는 방법이 있는지 궁금합니다. connectionoptions를 공백으로 남겨두면 기본값으로 표시되지 않습니다. null이됩니다. 그 이유는 사용자가 로그온/암호를 입력하지 않아도되기 때문입니다. 바로 이것이 Windows 통합 보안의 핵심입니다.System.Management.ConnectionOptions는 항상 텍스트에 암호가 필요합니까?

모든 정보를 제공해드립니다. 감사합니다.

답변

1

ConnectionOptions 생성자에 대한 설명을 this에서 살펴보십시오. 사용자 이름과 암호가 null이면 현재 로그온 한 사용자의 자격 증명이 사용됩니다.

ConnectionOptions options = new ConnectionOptions(...); 

// Make a connection to a remote computer. 
// Replace the "FullComputerName" section of the 
// string "\\\\FullComputerName\\root\\cimv2" with 
// the full computer name or IP address of the 
// remote computer. 
ManagementScope scope = 
      new ManagementScope(
      "\\\\FullComputerName\\root\\cimv2", options); 
scope.Connect(); 
+0

감사합니다. – tuseau

관련 문제