Microsoft KB Archive/243488

{|
 * width="100%"|

INFO: Default DCOM Impersonation Level Changed in Windows Management Instrumentation Version 1.5

 * }

Q243488

-

The information in this article applies to:


 * Windows Management Instrumentation, version 1.5
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Professional

-

SUMMARY
In Microsoft Windows Management Instrumentation version 1.5, the default DCOM impersonation level is RPC_C_IMP_LEVEL_IMPERSONATE. In earlier versions of WMI, the default level was RPC_C_IMP_LEVEL_IDENTIFY.

MORE INFORMATION
In WMI 1.1, you had to explicitly set the DCOM impersonation level to RPC_C_IMP_LEVEL_IMPERSONATE. For example, the following Microsoft Visual Basic code explicitly sets the impersonation level:

Set classObj = GetObject("WinMgmts:{impersonationLevel=impersonate}!//./root/cimv2:Win32_logicalDisk") For Each obj In classObj.instances_ ' Process this instance Next This step is no longer necessary. For example:

Set classObj = GetObject("WinMgmts://./root/cimv2:Win32_logicalDisk") For Each obj In classObj.instances_ ' Process this instance Next In WMI 1.1, the classObj.instances_ call would fail with error code 0x80041003 (WBEM_E_ACCESS_DENIED) because the provider needs to impersonate the client in order to access system information. Because WMI 1.5 impersonates the client by default, the code would succeed. However, you may still want to explicitly set the impersonation level in order to maintain compatibility with previous versions of WMI.