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



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional
  • Microsoft Windows Management Instrumentation 1.5

This article was previously published under Q243488

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.

REFERENCES

See the WMI programming documentation in the Platform SDK for more details.

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kbinfo kbWBEM KB243488